This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
1
pixi.js TextStyle centering
Post Flair (click to view more posts with a particular flair)
Post Body
I am doing a project which include a part where I use pixi.js
this is the screenshot of it:
I want the text Before which is written using PIXI.TextStyle to be where the black line is but for some reason I can't get it done.
this are my configuration settings in TextStyle:
const style = new PIXI.TextStyle({
fontFamily: 'MontSerrat',
align: 'center',
fontSize: 180,
fontWeight: 'bold',
lineHeight: 2.0,
fill: 0xFFFFFF,
strokeThickness: 5,
wordWrap: true,
wordWrapWidth: 440,
});
this.basicText = new PIXI.Text('BEFORE', style);
//this is how I center it
resize(width, height, position) {
this.basicText.x = (width - this.basicText.width) / 2;
this.basicText.y = (height / 2) - this.basicText.height; this.sprite.resize(width,height,'CC');
}
can someone help me to understand where is the problem?
Author
Account Strength
80%
Account Age
6 years
Verified Email
Yes
Verified Flair
No
Total Karma
251
Link Karma
97
Comment Karma
154
Profile updated: 1 hour ago
Posts updated: 3 months ago
Subreddit
Post Details
We try to extract some basic information from the post title. This is not
always successful or accurate, please use your best judgement and compare
these values to the post title and body for confirmation.
- Posted
- 4 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/CodingHelp/...