weratius Posted April 27, 2015 Share Posted April 27, 2015 Hello!!! I have a code, just a button created via Phaser://---------------------------------Bootmodule.exports = {init: function() {closeButton = game.add.button(w/1.47, h/1.272, 'close', this.closeProfile, this);closeButton.fixedToCamera = true;closeButton.inputEnabled = true;},closeProfile: function() {alert('asd')close.key = 'img/profile/closePress.png';}};Module.exports - this is Browserifyin the main file there is another code://---------------------------------Mainwindow.game = new Phaser.Game((h > w) ? h : w, (h > w) ? w : h, Phaser.CANVAS, 'game', {render:render});var ship;var cursors;var sun1;var rc;var space;var profile;var closeButton, holdLeft, holdRight, avaProfile;game.state.add('Boot', require('./states/boot.js'));game.state.add('Play', require('./states/play.js'));game.state.start('Boot');And button doesn't call a function at allI really can't get it!I will appreciate your helpThanks in advacne! Link to comment Share on other sites More sharing options...
rich Posted April 27, 2015 Share Posted April 27, 2015 This too appears to be a duplicate post. Link to comment Share on other sites More sharing options...
Recommended Posts