ユーザ用ツール

サイト用ツール

サイドバー

About

Contents

Materials Link

その他

PR


wiki:enchant.js:tips:004

004 テクスチャの表示

スプライトにテクスチャを張り付けて表示します。

// main.js
function preloadAssets()
{
	game = new Game(320,480);
	game.onload = init;
 
	game.preload("images/chara1.png");
 
	game.start();
}
 
function init()
{
	game.scale = 1;
	game.fps = 30;
	scene = new Scene();
	scene.backgroundColor = "#000";
	game.pushScene(scene);
 
	sprite = new Sprite(32, 32);
 
	sprite.image = game.assets["images/chara1.png"];
 
	sprite.backgroundColor = "#66F";
	sprite.x = 32;
	sprite.y = 32;
 
	scene.addChild(sprite);
 
	main();
}

ダウンロード enchantjs_std_texture.zip

Permalink wiki/enchant.js/tips/004.txt · 最終更新: 2014/11/07 09:11 (外部編集)

oeffentlich