ページへ戻る

− Links

 印刷 

StarlingのImage の変更点 :: NJF Wiki

xpwiki:StarlingのImage の変更点

« Prev[3]  
1: 2015-06-13 (土) 17:05:44 njf[4] ソース[5] バックアップ No.1 を復元して編集[6] 現: 2015-06-14 (日) 01:09:31 njf[4] ソース[7] 編集[8]
Line 1: Line 1:
-Starlingで画像を表示するにはImageを使う。+Starlingで画像を表示するにはImageを使う。ゲーム制作などで最も使う描画オブジェクトである。
テクスチャやビットマップから作成可能。 テクスチャやビットマップから作成可能。
 var image:Image = new Image(assets.getTexture(IMG_NAME));  var image:Image = new Image(assets.getTexture(IMG_NAME));
- + image.x = 10; 
- var texture:Texture = Texture.fromBitmap(new YourBitmap()); + image.y = 20; 
 + yourSprite.addChild(image); 
 + 
ドローコールを減らすために出来るだけテクスチャアトラスから取得した方が良い。 ドローコールを減らすために出来るだけテクスチャアトラスから取得した方が良い。
Line 44: Line 45:
 var filterRed:ColorMatrixFilter = new ColorMatrixFilter();  var filterRed:ColorMatrixFilter = new ColorMatrixFilter();
 filterRed.tint(0xFF0000, 0.8);  filterRed.tint(0xFF0000, 0.8);
 + 
 var redBlock:Image = new Image(blockTexture);  var redBlock:Image = new Image(blockTexture);
 redBlock.filter = filterRed;  redBlock.filter = filterRed;
 + 
色の変更については[[こちら:http://wiki.starling-framework.org/tutorials/modifying_the_color_of_an_image]]を参照のこと。 色の変更については[[こちら:http://wiki.starling-framework.org/tutorials/modifying_the_color_of_an_image]]を参照のこと。
« Prev[3]