1: 2015-06-13 (土) 17:05:44 njf |
現: 2015-06-14 (日) 01:09:31 njf |
- | 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); |
| + | |
| ドローコールを減らすために出来るだけテクスチャアトラスから取得した方が良い。 | | ドローコールを減らすために出来るだけテクスチャアトラスから取得した方が良い。 |
| | | |
| 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]]を参照のこと。 |