Image sizes

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Xharock
Posts: 71
Joined: Wed May 10, 2006 3:50 pm

Image sizes

Post by Xharock »

OK So I know I can't use textures that are not a square size i.e. 512 x 512 etc. So what if I want to display a logo which is 500 x 200 or something short of splitting it up into several square textures? I'm using IGUIImage to display 2D images on the screen.
jAyTeA
Posts: 36
Joined: Wed Sep 06, 2006 7:50 am
Location: Hattorf am Harz, Germany

Post by jAyTeA »

you can use textures which aren't square size!! But they should have power of two width and height. i.e. you can use a 512x256 pixel Image for your logo.
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

Or you use an image (not IGUIImage) !!!
There is no restriction with the size (can have any size you want since V1.2) !!!
And you can just get an area out of the image (no need to draw the full image) !!!
You should have a look at tutorial #6.2DGraphics for this...
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Xharock
Posts: 71
Joined: Wed May 10, 2006 3:50 pm

Post by Xharock »

I'll try making my logo Image a size that is a power of 2. How can I tell IGUIImage to only display part of it?
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

You can't do that with an IGUIImage !!!
have a look for draw2DImage(...), I think hat's what you need... ;)
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

you can, just use setPosition to set a new rectangle for the GUIImage, the parts you don't want to see will (should!) be clipped away.
if you want to change the position of the top left corner in the source image, then Acki is right, you can't do that with gui images
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
Post Reply