Please Help!

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

HeavyStorm
Just popping in
Just popping in
Posts: 11
Joined: Mon Oct 31, 2005 21:27
Contact:

Please Help!

Postby HeavyStorm » Mon Oct 31, 2005 21:48

Hello all,

I'm (as you will notice) very new to CEGUI. I'm currently working at a framework to use together with Ogre3D and in the near future I will be porting a game done with D3D to Ogre (and CEGUI).

Anyway, I have some questions that have risen when I was looking to add a property to an object. Let me clarify:

I am working with .xml descriptions of the Layout. The thing is, every component that I want to draw on the screen needs a new property, let's call it TEXT2.

What I have done (and has not worked so far) is writing on the xml the line:

Code: Select all

<Property Name="Text2"   Value="Google!" />


And I was hoping that CEGUI would just add that tuple to the component properties table. Unfortunatly, when I ask for the property, by making a call to Window::getProperty(), I get an exception. I know the exception means that the property is not in the iterator list.

***

I have not yet been able to understand how does CEGUI associates the hardcoded classes with the names in the xml file. I ask, to simply add a property to all classes will I have to make a child class for each component? Or there an easier way?

User avatar
martignasse
Just can't stay away
Just can't stay away
Posts: 227
Joined: Thu Apr 14, 2005 08:10
Location: Lyon, FRANCE

Re: Please Help!

Postby martignasse » Tue Nov 01, 2005 12:12

I am working with .xml descriptions of the Layout. The thing is, every component that I want to draw on the screen needs a new property, let's call it TEXT2.

What I have done (and has not worked so far) is writing on the xml the line:

<Property Name="Text2" Value="Google!" />

what you've tried is just initialise an already existing property, who, obviously, don't exist :(

To make this property available for you'r components, you have to customise the .looknfeel description of the skin.
You have to define the property for each of you'r components with the <PropertyDefinition> tag. :)

look at the Falagard doc in the wiki, <PropertyDefinition>

maybe there are other way but this one seem's to be the easiest.

Depending what you want to do but notice there is also some userData and userString available at window level :
userData
userString

hope it help

HeavyStorm
Just popping in
Just popping in
Posts: 11
Joined: Mon Oct 31, 2005 21:27
Contact:

Re: Please Help!

Postby HeavyStorm » Tue Nov 01, 2005 14:15

Thanks a lot, Martignasse. You shone a real light on the subject.

But, if it's not too much trouble, I still have some questions: I want to use the xml to hold the information, so can I fill the UserData field through the XML?

And, if you can point me to a good tutorial about look 'n feel files, I would be very pleased.

Thanks again, took a rope out of my neck.

HeavyStorm

User avatar
martignasse
Just can't stay away
Just can't stay away
Posts: 227
Joined: Thu Apr 14, 2005 08:10
Location: Lyon, FRANCE

Re: Please Help!

Postby martignasse » Tue Nov 01, 2005 14:55

But, if it's not too much trouble, I still have some questions: I want to use the xml to hold the information, so can I fill the UserData field through the XML?
I believe you can't, maybe with lua, but it's another story.
That's why the .looknfeel customisation could be the solution for you.


And, if you can point me to a good tutorial about look 'n feel files, I would be very pleased.
Unfortunatly, no tutorial are available, but i suggest you toread the Falagard system doc from the wiki or the distrib.
You can look into existing .looknfeel to try to understand the beast.

HeavyStorm
Just popping in
Just popping in
Posts: 11
Joined: Mon Oct 31, 2005 21:27
Contact:

Re: Please Help!

Postby HeavyStorm » Tue Nov 01, 2005 19:33

Ok, thanks a lot. It was really helpful, and I think I can make this work after all.

Thanks,
HS

User avatar
martignasse
Just can't stay away
Just can't stay away
Posts: 227
Joined: Thu Apr 14, 2005 08:10
Location: Lyon, FRANCE

Re: Please Help!

Postby martignasse » Wed Nov 02, 2005 18:03

cool,

and don't forget to put feedback of you'r experience on the forum (or a wiki page like "make you'r own properties" ) ;-)

a+


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 4 guests