61 lines
1.3 KiB
JavaScript
61 lines
1.3 KiB
JavaScript
/////////////////////////////
|
|
// Main game
|
|
|
|
/**** Phaser3 *****
|
|
|
|
var config = {
|
|
type: Phaser.AUTO,
|
|
width: 800,
|
|
height: 600,
|
|
physics: {
|
|
default: 'arcade',
|
|
arcade: {
|
|
gravity: { y: 200 }
|
|
}
|
|
},
|
|
scene: {
|
|
preload: preload,
|
|
create: create
|
|
}
|
|
};
|
|
|
|
var game = new Phaser.Game(config);
|
|
|
|
function preload() {
|
|
}
|
|
|
|
function create() {
|
|
console.log(game);
|
|
|
|
this.cameras.main.setBackgroundColor('#4d4d4d');
|
|
|
|
// game.stage.backgroundColor = '#4d4d4d';
|
|
// graphics = game.add.graphics(0, 0);
|
|
}
|
|
*/
|
|
var game = new Phaser.Game(1000, 800, Phaser.CANVAS, "RoundRectButton",
|
|
{preload:preload, create:create, update:update, render:render});
|
|
|
|
function preload() {
|
|
// game.load.image('phaser', '../../resources/image/phaser.png');
|
|
// game.load.spritesheet('button', './image/button_basic.png', 200, 100);
|
|
}
|
|
|
|
function create() {
|
|
// var i = game.add.image(game.world.centerX, game.world.centerY + 70, 'phaser');
|
|
// i.anchor.set(0.5);
|
|
game.stage.backgroundColor = '#4d4d4d';
|
|
graphics = game.add.graphics(0, 0);
|
|
|
|
|
|
let button = new RoundRectButton(new RectSetting(200, 100));
|
|
button.move(200, 200);
|
|
console.log(button);
|
|
}
|
|
|
|
function update() {
|
|
}
|
|
|
|
function render() {
|
|
}
|