Wintermute Engine Forum
Wintermute Engine => Technical forum => Topic started by: Jyujinkai on January 02, 2009, 01:51:50 AM
-
Mabey i am to tired or somthing but i am unable to see how to load a sprite onto the screen?
All i want to do is use a script to load a single sprite many times in diffrent places on the screen...
This is the code of the left click event i am using... all it is ment to do is load button.sprite and palce it at 70,41?
-
At first glance: You may have to activate or show the entity.
-
Entity is not sprite. Entity is a rather smart scene object and sprite is just one of its properties.
So you either need to load an *entity* from file (see the "Old Guy" in WME demo for reference) or create the entity dynamically in script:
Note that I'm using Scene.CreateEntity(), not Game.CreateEntity(). That will ensure that the entity is automatically destroyed after the player leaves the scene.
Also, entities are part of the scene. If you want to create user interface (judging by the name "button"), perhaps a window would be better suited. You can dynamically create buttons within a window in a similar fashion.