Page 1 of 1

Toolbar buttons offset

Posted: Tue Aug 23, 2005 4:28 pm
by rakkar
I added a toolbar and some buttons.

Code for the first button (also happens with tga format):

Code: Select all

video::ITexture * newButton = app.VideoDriver()->getTexture("media/editor/new.bmp");

toolBar->addButton(GenerateGUIIDByState(GUI_TOOLBAR_BUTTON_NEW), 0, newButton, newButton, false);
Here is what shows up:

Image

Here is the source image for one of the buttons:
Image

As you can see in the first image, the button images are offset in the toolbar. What can I do to fix this?

Posted: Tue Aug 23, 2005 11:50 pm
by Masdus
Is the toolbar large enough to display the image? From your pictures it looks like you need to make each button larger.

Posted: Wed Aug 24, 2005 2:35 pm
by Didine
Maybe, i have a solution but without programming : try to use a translate filter in a graphic software like Photoshop. Apply 50 % verticaly et 50 % horizontaly translation (menu filter>Misc.) for all you pictures.

Posted: Wed Aug 24, 2005 3:45 pm
by Fred
Are the texture coordinates wrong in the source?