draw2DImage versus addImage

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
asphodeli
Posts: 36
Joined: Thu Jul 24, 2008 12:46 am
Location: Singapore

draw2DImage versus addImage

Post by asphodeli »

Hi all, I've noticed that there are two ways to draw an image on-screen - one is to use the video driver's draw2DImage, and the other is the IGUIEnvironment's addImage. I suppose draw2DImage will consume less memory? Also, does the fader work on draw2DImage images?
nmn
Posts: 23
Joined: Tue Sep 02, 2008 7:35 pm

Re: draw2DImage versus addImage

Post by nmn »

asphodeli wrote:Hi all, I've noticed that there are two ways to draw an image on-screen - one is to use the video driver's draw2DImage, and the other is the IGUIEnvironment's addImage. I suppose draw2DImage will consume less memory? Also, does the fader work on draw2DImage images?
I'm going to take a very quick guess and say that draw2Dimage draws an image but addImage creates a widget that draws an image. I'm not entirely sure, but that's definitely what the names suggest.
Ion Dune
Posts: 453
Joined: Mon Nov 12, 2007 8:29 pm
Location: California, USA
Contact:

Re: draw2DImage versus addImage

Post by Ion Dune »

nmn wrote:draw2Dimage draws an image but addImage creates a widget that draws an image.
This is true.
asphodeli
Posts: 36
Joined: Thu Jul 24, 2008 12:46 am
Location: Singapore

Re: draw2DImage versus addImage

Post by asphodeli »

nmn wrote:
asphodeli wrote:Hi all, I've noticed that there are two ways to draw an image on-screen - one is to use the video driver's draw2DImage, and the other is the IGUIEnvironment's addImage. I suppose draw2DImage will consume less memory? Also, does the fader work on draw2DImage images?
I'm going to take a very quick guess and say that draw2Dimage draws an image but addImage creates a widget that draws an image. I'm not entirely sure, but that's definitely what the names suggest.
well, okay, but i'm just wondering if the fader works for draw2DImage, i.e. the fader will "cover up" the draw2DImage
Ion Dune
Posts: 453
Joined: Mon Nov 12, 2007 8:29 pm
Location: California, USA
Contact:

Post by Ion Dune »

Sounds like it should be easy enough to test, but looking at the source code it seems that it should. Why don't you give it a try?
kornwaretm
Competition winner
Posts: 189
Joined: Tue Oct 16, 2007 3:53 am
Location: Indonesia
Contact:

Post by kornwaretm »

there is SColor parameter in draw2DImage. just set and decrease the alpha value.
asphodeli
Posts: 36
Joined: Thu Jul 24, 2008 12:46 am
Location: Singapore

Post by asphodeli »

Ion Dune wrote:Sounds like it should be easy enough to test, but looking at the source code it seems that it should. Why don't you give it a try?
Have done it, fader does not change the alpha values. Ah well, I could always custom-class a IGUIElement. 8)
Post Reply