Jump to content

Have Empty Sprites Changed?


Cryptonomicon
 Share

Recommended Posts

Has the behaviour of empty sprites changed?  

 

I was using them as a container for a button instead of a group because I wanted the onInputDown handlers.  But now I am getting spurious data. I am attempting to resolve by giving them a one pixel no alpha image.  

 

Empty sprites used to be - well empty. Now they seem to be picking up a random image

 

Is it a bug or expected behaviour?

 

 

And in case anyone asks why dont I use buttons - at the time I wrote the code - a year back there was an issue with the stock button - cant remember what now - and I had a need to have a collection of different states corresponding to different lifecycle stages so I rolled my own.

Link to comment
Share on other sites

I had a similar issue and resolved it by just not supplying empty sprites with a key, i.e. just using

var sprite = game.add.sprite(0, 0)
I've got another (maybe related) issue now, though - some sprites drawn using a BitmapData as a source get the wrong texture. They're not supposed to be empty, but draw the wrong thing instead. Can this be worked around?
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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