mirror of
https://github.com/wassname/phaser.git
synced 2026-08-12 12:20:38 +08:00
Testing new Image object.
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
|
||||
var game = new Phaser.Game(800, 600, Phaser.CANVAS, 'phaser-example', { preload: preload, create: create, update: update, render: render });
|
||||
|
||||
function preload() {
|
||||
|
||||
game.load.image('pic', 'assets/pics/backscroll.png');
|
||||
|
||||
}
|
||||
|
||||
var image;
|
||||
var image2;
|
||||
|
||||
function create() {
|
||||
|
||||
image = game.add.image(32, 50, 'pic');
|
||||
|
||||
image2 = game.add.image(32, 250, 'pic');
|
||||
|
||||
game.input.onDown.add(tint, this);
|
||||
|
||||
}
|
||||
|
||||
function tint() {
|
||||
|
||||
image.tint = Math.random() * 0xFFFFFF;
|
||||
|
||||
}
|
||||
|
||||
function update() {
|
||||
|
||||
// image.angle += 1;
|
||||
|
||||
}
|
||||
|
||||
function render() {
|
||||
|
||||
// game.debug.renderText(sprite.position.y, 32, 32);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user