Page 1 of 1

Please Help!

Posted: Mon Oct 31, 2005 21:48
by HeavyStorm
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?

Re: Please Help!

Posted: Tue Nov 01, 2005 12:12
by martignasse
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

Re: Please Help!

Posted: Tue Nov 01, 2005 14:15
by HeavyStorm
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

Re: Please Help!

Posted: Tue Nov 01, 2005 14:55
by martignasse
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.

Re: Please Help!

Posted: Tue Nov 01, 2005 19:33
by HeavyStorm
Ok, thanks a lot. It was really helpful, and I think I can make this work after all.

Thanks,
HS

Re: Please Help!

Posted: Wed Nov 02, 2005 18:03
by martignasse
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+