Changing the image on a Thumb

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

User avatar
arkos
Quite a regular
Quite a regular
Posts: 49
Joined: Thu Apr 27, 2006 21:45

Changing the image on a Thumb

Postby arkos » Sun Jun 11, 2006 02:40

Hey guys,

I am using windows look and I am trying to make a slider in my game that has a different picture on it than the regular slider. Since the slider Thumb inherits from push button class I thought that the following code would work.

Code: Select all

CEGUI::Thumb *thumb = (CEGUI::Thumb*)wmgr.getWindow(hud_power_slider);
   thumb->setPushedImage(image);


This is the same code I use for pushbutton images, but it looks like Thumbs can't do the same thing. The image remains as the thumb default image. I don't want to change the window's look targa because the image I want to put on the slider is pretty big. Any ideas?

User avatar
arkos
Quite a regular
Quite a regular
Posts: 49
Joined: Thu Apr 27, 2006 21:45

Postby arkos » Sun Jun 11, 2006 03:20

alright, I don't know the correct way to acheive a custom image on the slider thumb, but what I did as a work around was place a static image on top of the thumb. The image has the same size and position as the thumb. Then in code, I setEnabled(false) on the image window and subscribe the thumb to an event that matches the images position with the thumb. Now I can click and drag the image wherever I want.


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 8 guests