1.x、y
(1)介绍
(2)使用方法
var plane = new PIXI.Sprite.fromImage("res/plane_blue_01.png");
plane.x = 100;//设置水平方向位置
plane.y = 200;//设置垂直方向位置
app.stage.addChild(plane);
2.width、height
(1)介绍
(2)使用方法
var plane = new PIXI.Sprite.fromImage("res/plane_blue_01.png");
plane.width = 100;//设置宽度
plane.height = 80;//设置高度
app.stage.addChild(plane);
3.rotation
(1)介绍
(2)使用方法
var plane = new PIXI.Sprite.fromImage("res/plane_blue_01.png");
plane.rotation = 1;//设置旋转的角度为弧度 1
app.stage.addChild(plane);
4、scale
(1)介绍
(2)使用方法
var plane = new PIXI.Sprite.fromImage("res/plane_blue_01.png");
plane.scale.x = 2;//水平方向缩放为原来的2倍
plane.scale.y = 2; //垂直方向缩放为原来的2倍
app.stage.addChild(plane);
注意:如果 plane.scale.x 或 plane.scale.y 设置为 -1 时,可实现图片水平或垂直翻转。
5、visible
(1)介绍
(2)使用方法
var plane = new PIXI.Sprite.fromImage("res/plane_blue_01.png");
plane.visible = true; //true或者false
app.stage.addChild(plane);
6、alpha
(1)介绍
(2)使用方法
var plane = new PIXI.Sprite.fromImage("res/plane_blue_01.png");
plane.alpha = 0.5;
app.stage.addChild(plane);
7、text
(1)介绍
(2)使用方法
var score = new PIXI.Text("得分:10000");
score.text = “飞机大战真好玩!”;//设置显示内容
app.stage.addChild(score);
8、style
(1)介绍
(2)使用方法
var score = new PIXI.Text("得分:10000");
score.style.fill = 0xffffff;//设置字体颜色
score.style.fontSize = 50;//设置字体大小
score.style.fontWeight = "bold";//加粗
score.style.fontStyle = "italic";//斜体
score.style.fontFamily = "隶书";//设置字体
app.stage.addChild(score);