Joined: 12/27/2013(UTC) Posts: 11 Location: Bayern
|
Hi!
The last question for today, I promise. ;)
What is the best way to work with the Scenes? I can create Scenes in the DeltaEngine-Editor and I can Show and hide them from code. But there is no clear way to attach code to the controls in the Scene without creating some Kind of "glue code". I Need to search for specific controls in the Controls-Collection of the Scene, cast them to InteractiveButton an attach a Delegate to the Clicked-Action. Is there a better way of doing this? How about creating a Kind of Scene-Controller-Class on saving of the Scene, that automatically creates Clicked-Actions/Events I can bind to? Or how is it supposed to be done? None of the Starter Kit really uses prebuild Scenes, as far as I know.
Thank you!
Best regards
TopperDEL
|
|
|
|
Joined: 8/23/2011(UTC) Posts: 245
Thanks: 6 times Was thanked: 12 time(s) in 11 post(s)
|
Right now there isn't really a better way to do it than the way you suggest.
If you can flesh out some more details on how you'd like a Controller class to work it can certainly be considered.
One way that occurs to me on reading your post is that there could be a method in Scene that takes a string tag and Action code and searches for the control with that tag and adds the given code to the Clicked delegate.
Would that sort of thing work for you?
(Oh, and feel free to keep asking as many questions as you like ;))
|
|
|
|
Joined: 12/27/2013(UTC) Posts: 11 Location: Bayern
|
Yes, that method would help. Imagine a MainMenu in a game with just one button: "Close game". To Close the app on click of that button would Need much more code to find the button and to attach an Event handler then the actual closing Needs. Your suggested Method would work, yes - I then onle had one method call with one Lambda Expression.
|
|
|
|
Medals:  Joined: 8/20/2011(UTC) Posts: 1,421 Location: Hannover
Thanks: 18 times Was thanked: 97 time(s) in 92 post(s)
|
We got quite a few suggestions for the UI Editor and Scenes in general in recent weeks. For the past 2 months most of the editor and game team have been focusing on getting our example game Creepy Towers to work, now we have more time to improve scenes and the Editor to support scenarios like the one you describe (simple auto-generated code from the editor to get started with a freshly build scene). I have written down a feature request for this. This topic will be updated once such a feature is available.
|
|
|
|
Joined: 12/27/2013(UTC) Posts: 11 Location: Bayern
|
Thanks! I'm really happy about the way you react on Feedback so far! :)
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.