I have another (this time much more) noobish question...)
We have an option to define GUI sheet through the layout editor - are there any ways to define whole state machine of GUI through the facilities of CEGUI?
For example we have an XML with predefined actions - if this button pressed - we setting this sheet if another - another sheed...
GUI state machine
Moderators: CEGUI MVP, CEGUI Team
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: GUI state machine
Hi,
At the present time there is no way to specify automatic transitions from one sheet to another; it always requires user code of some kind
There are some things you could try though to get an automated sheet switching system in place with a minimum of code and some property support (which should expose it to the editor). The basic recipe would be something like this:
1) In the looknfeel for your button type, add a PropertyDefinition that will hold the name of the target sheet (called "TargetSheet" in this example)
2) Subscribe a handler to the global event set for "PushButton/Clicked"
3) In the handler code, check to see if the "TargetSheet" property exists, if so read the value.
4) If the target sheet is not empty and not == to the current sheet, set it as the new sheet.
5) ???
6) Profit!
I think that's a really simple way to provide automated sheet switching based on button clicks, with a minimal amount of code (i.e. about 6 lines or so).
HTH
CE.
At the present time there is no way to specify automatic transitions from one sheet to another; it always requires user code of some kind
There are some things you could try though to get an automated sheet switching system in place with a minimum of code and some property support (which should expose it to the editor). The basic recipe would be something like this:
1) In the looknfeel for your button type, add a PropertyDefinition that will hold the name of the target sheet (called "TargetSheet" in this example)
2) Subscribe a handler to the global event set for "PushButton/Clicked"
3) In the handler code, check to see if the "TargetSheet" property exists, if so read the value.
4) If the target sheet is not empty and not == to the current sheet, set it as the new sheet.
5) ???
6) Profit!
I think that's a really simple way to provide automated sheet switching based on button clicks, with a minimal amount of code (i.e. about 6 lines or so).
HTH
CE.
Useful Links: Forum Guidelines | Documentation | Tutorials | HOWTO | Videos | Donate to CEGUI | CEGUI Twitter
Who is online
Users browsing this forum: No registered users and 7 guests