Friday, September 23, 2011

Dispenser Box UI class test

I wanted a UI element that would have a thumbnail of an item that could be clicked and dragged onto the stage. The biggest challenge was generating sprite placeholder
images from the actual classes. When you click on one of the balls in the small square boxes, you are actually interacting with a placeholder sprite.
When the ball is dropped, an instance of the class associated with that placeholder
sprite is spawned. The placeholder sprite then returns to the origin of the
dispenser box. Sprite placeholder images were used rather than the ACTUAL
class objects because I did not want the objects to react with the mouse
until dropped into position. This would also create problems since both the UI and
the spawned class instance inside of it might end up fighting for focus in strange ways.


No comments:

Post a Comment