moved text style params to separated object
This commit is contained in:
parent
e02b813e80
commit
b848f34f69
2 changed files with 54 additions and 51 deletions
|
@ -58,20 +58,20 @@
|
|||
requestAnimFrame( animate );
|
||||
|
||||
// creat some white text using the Snippet webfont
|
||||
var textSample = new PIXI.Text("Pixi.js can has\nmultiline text!", "50px Snippet", "white", "center");
|
||||
var textSample = new PIXI.Text("Pixi.js can has\nmultiline text!", {font: "50px Snippet", fill: "white", align: "center"});
|
||||
textSample.anchor.x = 0.5;
|
||||
textSample.position.x = 620/2;
|
||||
textSample.position.y = 10;
|
||||
|
||||
// create a text object with a nice stroke
|
||||
var spinningText = new PIXI.Text("I'm fun!", "bold 60px Podkova", "#cc00ff", "center", "#FFFFFF", 6);
|
||||
var spinningText = new PIXI.Text("I'm fun!", {font: "bold 60px Podkova", fill: "#cc00ff", align: "center", stroke: "#FFFFFF", strokeThickness: 6});
|
||||
// setting the anchor point to 0.5 will center align the text... great for spinning!
|
||||
spinningText.anchor.x = spinningText.anchor.y = 0.5;
|
||||
spinningText.position.x = 620/2;
|
||||
spinningText.position.y = 400/2;
|
||||
|
||||
// create a text object that will be updated..
|
||||
var countingText = new PIXI.Text("COUNT 4EVAR: 0", "bold italic 60px Arvo", "#3e1707", "center", "#a4410e", 7);
|
||||
var countingText = new PIXI.Text("COUNT 4EVAR: 0", {font: "bold italic 60px Arvo", fill: "#3e1707", align: "center", stroke: "#a4410e", strokeThickness: 7});
|
||||
countingText.position.x = 620/2;
|
||||
countingText.position.y = 320;
|
||||
countingText.anchor.x = 0.5;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue