Drawing 2d image in Window?

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.
Magus_Stragus
Posts: 86
Joined: Wed Aug 29, 2007 10:45 pm

Post by Magus_Stragus »

So, I tried to use IGUIImage, and it seems better than draw2DImage, except for something: is there a way to take only a portion of the image file and draw only that portion? I mean, IGUIImage takes a texture to draw, and the texture is taken directly from a image file. I only want to use a portion (a rectangle) of the image file in the IGUIImage. How can I do that?
Proud member of the Online Campaign for Real English. If you believe in capital letters, correct spelling and good sentence structure then copy this into your signature.
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

Magus_Stragus wrote:So, I tried to use IGUIImage, and it seems better than draw2DImage, except for something: is there a way to take only a portion of the image file and draw only that portion? I mean, IGUIImage takes a texture to draw, and the texture is taken directly from a image file. I only want to use a portion (a rectangle) of the image file in the IGUIImage. How can I do that?
The answer lies in my original post in this thread (emphasis added)...
vitek wrote:You need to use a gui element. Either write your own that calls draw2DImage() or use IGUIImage.
Magus_Stragus
Posts: 86
Joined: Wed Aug 29, 2007 10:45 pm

Post by Magus_Stragus »

So, I tried to do that. I took the CGUIImage files included in the source folder and modified them so I could extract just a portion of the wanted texture. However, now I can't seem to make it work. It's my first time creating (well, modifying) a GUI element, so I could use a little help with that.

I would appreciate any help.
Proud member of the Online Campaign for Real English. If you believe in capital letters, correct spelling and good sentence structure then copy this into your signature.
Post Reply