Jump to content

Buttons using spritesheet texture sometimes load whole spritesheet instead of one frame


Recommended Posts

Not sure why this happens, but spontaneously, say once every 15 loads, my buttons that are using spritesheets load the whole spritesheet instead of one individual frame (like they're supposed to, like they do most of the time).


When it happens they still function normally as buttons, they still trigger their function, but the frames don't change on hover and they remain displaying the whole sheet.


Attached a screenshot of three buttons in the state I'm talking about. They are supposed to be just the red rings, but the yellow frame is showing.


Any ideas? Ever seen this happen before? I looked around but didn't find anyone else with this problem.


Link to comment
Share on other sites

Yeah you're right


I'm making them in maybe a weird way ?


This is how I create them:

(this.markers.select is a method I created and added to the markers group)

this.markers = this.add.group();for (var i = 0, j = 3; i < j; i++) {    var marker = this.markers.create(0, 0, 'marker', this.markers.select, this, 1, 0, 1, 0);    marker.anchor.set(.5,.5);    marker.inputEnabled = true;    marker.input.useHandCursor = true;    this.physics.enable(marker, Phaser.Physics.ARCADE);}

And I position them later (x and y are calculated beforehand)

this.markers.children.forEach(function(s) {    s.position.set(x, y);});
Link to comment
Share on other sites


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...