Basics Function of CEGUI

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

Willikus
Just popping in
Just popping in
Posts: 4
Joined: Fri Apr 25, 2008 10:54

Basics Function of CEGUI

Postby Willikus » Fri Apr 25, 2008 11:20

Hi.
I'm french, so my writting is... bad

Lately I use OGRE as motor 3D and I must succeed has use CEGUI...
Except, I do not arrive at the using in spite of the help of the API...
Nowadays, I need to understand how shown simple pictures and simple text... In brief, if somebody could explain me basic functioning or give me functional samples.


Thank you in advance,
W

Rackle
CEGUI Team (Retired)
Posts: 534
Joined: Mon Jan 16, 2006 11:59
Location: Montréal

Postby Rackle » Fri Apr 25, 2008 14:46

WidgetGalore shows the basic use of almost every widget available to Cegui. This should be a good starting point. There are also samples included with the Cegui distribution. Finally you could take a look at the various code snippets in the wiki.

Since you are using Ogre, you may want to have a look at the Basic Tutorial 7 - CEGUI and Ogre. However be aware that Ogre is not using the latest version of Cegui. You could read through the Upgrading to Cegui v0.5.0 post and wiki to upgrade your version. It is outdated but the principle/process should still be valid.

Willikus
Just popping in
Just popping in
Posts: 4
Joined: Fri Apr 25, 2008 10:54

Postby Willikus » Fri Apr 25, 2008 15:19

Thx,
I have look at the "CEGUI and Ogre" Tutorial but... it treats only superficially subject...

I am going to look at your links,

a+
w

daves
Home away from home
Home away from home
Posts: 253
Joined: Thu Feb 02, 2006 20:12

Postby daves » Fri Apr 25, 2008 23:16

Williikus,
You will find that the API is extremely powerful, and very elegant. Please spend the time, and get past the learning curve.

Its worth it, and you'll get to a point where you actually enjoy writing CEGUI code (just as with Ogre).

As you have specific quetoins, please post. With a specific question in mind (for example "how do you create a buitton", or "how do you pass keyboard and mouse events to CEGUI") it will be much easier for CEGUI users and developers to give you answers that will get you up and running quickly.

Good luck and have fun.

Willikus
Just popping in
Just popping in
Posts: 4
Joined: Fri Apr 25, 2008 10:54

Postby Willikus » Sat Apr 26, 2008 09:45

Daves,
I'm a small programmer (it is not my work), my manner of
learn is not therefore strict ( I touch on everything )
So, I use a lot the API ^^

But the "system implementation of the code" is not whrite in API...
But, you're right, I will ask frankly :
-"How inserted an image without using window ?"

:)

(sry for the previous link, I not had time to read his)

a+
w

daves
Home away from home
Home away from home
Posts: 253
Joined: Thu Feb 02, 2006 20:12

Postby daves » Sat Apr 26, 2008 10:26

Willikus wrote:-"How inserted an image without using window ?"


If what you mean is that you want to display an image in your application then CEGUI makes this quite easy, though you would certainly need to use a CEGUI window -- CEGUI is all about windows.

There are a couple of Windows that you will find in the WindowsLook scheme/looknfeel that support images.

For example you can easily use the "WindowsLook/StaticImage" window to display an image. There is a property on this window (called "image") that you would set to the name of an image in an imageset.

A quick forum search exposes this link in particular:

http://www.cegui.org.uk/phpBB2/viewtopi ... taticimage

Take a look, it touches both on imagesets, and on the process of creating the window that displays the image.

Extraction of the first and last line of code

Code: Select all

label = win_mgr.createWindow("TaharezLook/StaticImage", name.append( "Label") );

...

label->setProperty("Image", "set:test image:shield");


allows you to see the basic calls.. you create a window of type TaharezLook/StaticImage then after a bit of configuration of the window you set its Image property to display an image of a shield.

Other links worth looking at..
The first one discusses creation and modification of imagesets (and the images they contain) programmatically
http://www.cegui.org.uk/phpBB2/viewtopi ... etproperty

The second one does the same and then applies the image to an already created staticimage window.

http://www.cegui.org.uk/phpBB2/viewtopi ... etproperty


Does this help?

Willikus
Just popping in
Just popping in
Posts: 4
Joined: Fri Apr 25, 2008 10:54

Postby Willikus » Sat Apr 26, 2008 12:14

So... with your first link I did this :

Code: Select all

 
CEGUI::Imageset* imageSet2 = CEGUI::ImagesetManager::getSingleton().getImageset((CEGUI::utf8*)"TaharezLook");
        CEGUI::Window* si2 = CEGUI::WindowManager::getSingleton().createWindow((CEGUI::utf8*)"TaharezLook/StaticImage", (CEGUI::utf8*)"NewStaticImage" );
        si2->setProperty("FrameEnabled", "false");
        si2->setProperty("BackgroundEnabled", "false");
        si2->setSize(CEGUI::UVector2( CEGUI::UDim(0.7f, 0), CEGUI::UDim(0.8f, 0)));
        si2->setProperty("Image", CEGUI::PropertyHelper::imageToString(&imageSet2->getImage((CEGUI::utf8*)"MouseMoveCursor")));

     EditorGuiSheet->addChildWindow(si2);


And I have a picture :)
I am going to play with pictures to understand functioning definitely...

Thanks for your help Daves

(Afterwards I attack the text)


Return to “Help”

Who is online

Users browsing this forum: No registered users and 15 guests