Page 1 of 1

Changing the image on a Thumb

Posted: Sun Jun 11, 2006 02:40
by arkos
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?

Posted: Sun Jun 11, 2006 03:20
by arkos
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.