Page 1 of 1

how to create a new element ?

Posted: Fri May 18, 2007 13:25
by Thor22
Hi all,

For my project I need to create a rotative element (like a boussole) in ogre3d's engine and then I writed somes methods to render this and I created a new class to create this element.
Next I would like to integrate it to CEGUI's engine and to be able to export it in scripting engine (like .layout and Lua).
My question : How can I do this ? :)

Thanks for help (and sorry if I make some mistakes, I am french ^^)

Posted: Fri May 18, 2007 14:17
by Rackle
Have a read through the Wiki, especially the Falagard stuff. You won't be able to integrate it automatically into the Layout Editor. Not with the current version.

Maybe one day we'll recode Cegui with better descriptions in code, such as "I am a parent widget", "I am a child widget of x", "I can only be included as a child of this parent widget". Yes this is cryptic but if you've read through the Layout Editor code (or this post) you'll understand what I mean...

Posted: Fri May 18, 2007 16:14
by Thor22
I don't use the layout editor, I write manually my layout files ^^

Posted: Sat May 19, 2007 08:28
by martignasse
hi thor22,

If i anderstand correclty, you want to create a new element in the set of widgets you use in you'r scheme file ?

If it's that, there differents way of doing this.

You can just declare a new widget name in the scheme file derivated from an existing generic widget, and custom it in the look'nfeel file.

Or you can make a completly new widget from scratch. In the CEimageset Editor, there is a new element, the "ElasticBox", who is coded from scratch and derivate from CEGUI::window.

You have to explore the source code to find all what is needed.
You can also look at the CEGUI_TreeControl, made by DrPain

I don't remenber exactly, but there is a thread where crazy eddie talk about what is needed to add a new element to CEGUI.

hope it help

Posted: Sun May 20, 2007 17:52
by Thor22
Ok I will explore the source code :wink:
But just a last question : Do I need to recompile the CEGUI's source to integrate my new element's code or a include in my project is enough ?

Thanks for all, Thor

Posted: Sun May 20, 2007 20:08
by martignasse
No need to recompile cegui.
You'r new element will be stored in you'r appli.exe file.