Repeated IGUIImage

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
mistral
Posts: 14
Joined: Mon Jan 23, 2017 9:35 am

Repeated IGUIImage

Post by mistral »

Hi,

I can repeat a texture using a material, but is there way to do same for a gui window background / image?

Thanks
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Repeated IGUIImage

Post by CuteAlien »

Hm, not directly supported. You can get it somewhat to repeat itself by setting setScaleImage(true) and then using setSourceRect with a rectangle larger than the texture is. I think the rectangle kinda works like uv-coordinates. But it's probably not exactly what you want. I haven't experimented yet too much, so maybe playing around with those 2 functions somehow can give you that result.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
mistral
Posts: 14
Joined: Mon Jan 23, 2017 9:35 am

Re: Repeated IGUIImage

Post by mistral »

Thanks, but I'm not finding "setSourceRect" or something similar in either IGUIImage or ITexture.


If this not available, would it be better to generate an image and use that or to instead use numerous IGUIImages using the original image tile?
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Repeated IGUIImage

Post by CuteAlien »

Oh, right, that one is new in IGUIImage (if you switch to Irrlicht trunk version from svn you get that).
Numerous IGUIImages - less memory, using a single texture with repeated images - maybe somewhat faster and less code to write.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply