vispik88 Posted May 29, 2015 Share Posted May 29, 2015 Hi.I have one problem with loading audio files at phaser. Sometimes when i open my game at first time (clear all cache), i look at firebug that my sounds are loading now. And then after loading game became start. The problem is that all buttons doesn't clickable and i have no opportunities to make any action. When i refresh the page - it's all became good. But this problem is not permanent and i don't understand what the reason. Help me please, it is very important Link to comment Share on other sites More sharing options...
vispik88 Posted May 29, 2015 Author Share Posted May 29, 2015 As i know from my partners, the reason is not audio. The reason is disable click by button:Below is a code:1) object - simple js object2) object.layer - link to created buton3) If game starts i have two console.log messages: "set cursor" and "add event"4) Then i try to click the button and i have no any messages. There are no pointer cursor when i hover the button and it is not clickable. After refresh the page - it became ok Anybody can help me? Thanksdefine(['phaser_layer', 'models/seat'], function(phaser_layer, seat_model) { var public = function(context) { this.phaser_layer = phaser_layer; var that = this; this.create = function(seat_number, position, click) { var object = new seat_model(seat_number, position, click); object.layer = this.phaser_layer.layer.add.button(position.x, position.y, this.phaser_layer.asset_definitions.player_open_seat); object.layer.inputEnabled = true; object.layer.input.useHandCursor = true; console.log('set cursor'); object.layer.events.onInputDown.add(function() { console.log('click'); object.onClick(object, click); }, this); console.log('add event'); return object; } } return new public(this);}) Link to comment Share on other sites More sharing options...
Recommended Posts