目次

003 スプライトの表示

概要

スプライトを表示します。

ソースコード

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

ダウンロード

enchantjs_std_sprite.zip