phaser/Tests/input/over sprite 1.js

19 lines
679 B
JavaScript

/// <reference path="../../Phaser/Game.ts" />
(function () {
var game = new Phaser.Game(this, 'game', 800, 600, init, create, null, render);
function init() {
// Using Phasers asset loader we load up a PNG from the assets folder
game.load.image('sprite', 'assets/sprites/atari130xe.png');
game.load.start();
}
var sprite;
function create() {
sprite = game.add.sprite(200, 200, 'sprite');
// Enable Input detection
sprite.input.start(0, false, true);
}
function render() {
Phaser.DebugUtils.renderInputInfo(32, 32);
Phaser.DebugUtils.renderSpriteInputInfo(sprite, 300, 32);
}
})();