Shapeの透明化
// グローバルに展開
phina.globalize();
// メインシーン
phina.define("MainScene", {
// 継承
superClass: 'DisplayScene',
//初期化
init: function () {
//親クラス初期化
this.superInit();
//背景色
this.backgroundColor = 'lightgray';
// Shapeを作成してシーンに追加
var shape = Shape().addChildTo(this);
//指定位置
shape.setPosition(320, 480);
//透明化
//shape.alpha = 0;
//非表示
//shape.hide();
//再表示
//shape.show();
//背景色指定
shape.backgroundColor = 'red';
},
//毎フレーム更新処理
update: function () {
//以下にコードを書いていく
},
});
▷Shapeの透明化
//透明化 shape.alpha = 0;
オブジェクト自体は存在するため、当たり判定やタッチ処理は有効。
▷Shapeの非表示
//非表示 shape.hide();
描画自体されず、当たり判定やタッチ処理は無効になる。
▷Shapeの再表示
//再表示 shape.show();