howto draw a texture on a window?

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

User avatar
realtiger
Just popping in
Just popping in
Posts: 12
Joined: Thu Dec 14, 2006 05:10

howto draw a texture on a window?

Postby realtiger » Fri Dec 15, 2006 16:36

Hi

I want to make a simple chess board.
So I have to render some textures on window.
How can I do so?
I need it, please.
Thank u.

Pompei2
Home away from home
Home away from home
Posts: 489
Joined: Tue May 23, 2006 16:31

Postby Pompei2 » Fri Dec 15, 2006 23:09

You can use a StaticImage widget, look in the samples for the exact usage.

User avatar
realtiger
Just popping in
Just popping in
Posts: 12
Joined: Thu Dec 14, 2006 05:10

Postby realtiger » Sat Dec 16, 2006 03:04

Is this the way to use StaticImage?

Code: Select all

    // load an image to use as a background
    ImagesetManager::getSingleton().createImagesetFromImageFile("BackgroundImage", "GPN-2000-001437.tga");

    // here we will use a StaticImage as the root, then we can use it to place a background image
    Window* background = winMgr.createWindow("TaharezLook/StaticImage", "background_wnd");
    // set position and size
    background->setPosition(UVector2(cegui_reldim(0), cegui_reldim( 0)));
    background->setSize(UVector2(cegui_reldim(1), cegui_reldim( 1)));
    // disable frame and standard background
    background->setProperty("FrameEnabled", "false");
    background->setProperty("BackgroundEnabled", "false");
    // set the background image
    background->setProperty("Image", "set:BackgroundImage image:full_image");


I think there should be a CEGUI::StaticImage class. :?:

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

Postby Rackle » Sat Dec 16, 2006 14:32

>> I think there should be a CEGUI::StaticImage class.

If you look at the stuff I've wikied, that's pretty much what I've done. These are helper classes, building higher level structures/classes to simplify Cegui usage.

You have created the static image via code. Myself I tend to create them via the layout editor, so I do not have a great need for a specific class; the layout editor fills in all those function calls for me (by specifying the attributes within the .layout file).

User avatar
realtiger
Just popping in
Just popping in
Posts: 12
Joined: Thu Dec 14, 2006 05:10

Postby realtiger » Sat Dec 16, 2006 15:14

I have tried

Code: Select all

staticImage = (CEGUI::StaticImage*)wndMgr.getWindow("Root/PlayWindow/Avatar01SImage");


But still get the error: StaticImage is not a member of CEGUI. So I have to use CEGUI::Window class and set image by using SetProperty method.


Return to “Help”

Who is online

Users browsing this forum: MSN [Bot] and 11 guests