Character Selection Screen

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

mrbolha
Just popping in
Just popping in
Posts: 7
Joined: Wed Apr 19, 2006 19:41

Character Selection Screen

Postby mrbolha » Fri Jul 07, 2006 17:22

Hello.

I am having a little trouble conceiving a simple screen using the Falagard System.

The idea is quite simple: a bunch of "icons" representing game characters, and a big image which represents a conceptual "zoom" of the "selected" character.

What would be a good way to do it with Falagard? Would I have to create a different "falagard button" derivation for each "icon", even if all buttons are similar, functionally speaking?

And how about the "zoom" component? I thought it could be a "static image", but how do I change the picture if I use the 0.5 version of the library? Do I have again to create separate "static image" derivations for each possible version?

Thanks,
Leonardo Mesquita

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

Postby Rackle » Fri Jul 07, 2006 20:03

Have a look at Widget Galore to convert the static image.

One approach would be to present a bunch of Pushbutton, each representing a character slot. Within these buttons you can place a StaticImage (small character image) to the left and a StaticText (character name, server, location) to the right; these would be children of the Pushbutton. (I know that StaticImage and StaticText are dead but the concept lives on.) In code you specify that they should pass mouse clicks to their parent: it's a function with a name like mouseClickPassthrough().

Trap the Pushbutton click event. In that function/trigger specify a different image for the "big zoom image":

Code: Select all

ImagesetManager::getSingleton().createImagesetFromImageFile("ImageForStaticImage", "GPN-2000-001437.tga");
DefaultWindow* staticImage = static_cast<DefaultWindow*>(winMgr.getWindow("StaticImage"));
staticImage->setProperty("Image", "set:ImageForStaticImage image:full_image");


Or if the character slot was empty start the code to create a new character.

You could augment this by first specifying a StaticText with a border, then a child Pushbutton, then the children StaticImage and StaticText. When the Pushbutton is clicked you can show the border in a different (as in a highlight) color.

Edit: on second though you probably do not need Pushbutton; it should be possible to trap mouse clicks on a StaticImage and StaticText (the character icon and description).

User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

Postby lindquist » Fri Jul 07, 2006 21:33

This would'nt really be using falagard.
In Falagard you can create a new property for the widget which will hold the icon imageset and image name.

You then use a ImageryComponent to draw the icon via the ImageProperty tag.
Take a look at WindowsLook/IconButton or TaharezLook/Button (0.5) for pointers.
Or you can look at the first "falagard beginner tutorial" in the wiki. It goes through making a looknfeel for a button that just shows an image.

HTH


Return to “Help”

Who is online

Users browsing this forum: No registered users and 26 guests