How to draw2DImage without a specific pixel?
E.g I have a 16x16 image and I want to draw it without the pixel at 8x8, how can I accomplish that?
Thanks.
How to draw2DImage without a specific pixel?
-
- Posts: 107
- Joined: Sat Nov 04, 2006 9:42 pm
-
- Posts: 368
- Joined: Tue Aug 21, 2007 1:43 am
- Location: The Middle of Nowhere
Yeah there's no other way to do it really... Technically you could do it by drawing it onto something more complicated than a simple 2 poly quad and have a 1 pixel gap in the quad where you don't want anything drawn but that would be a bit too complicated for your needs and i suspect you might want to not draw any number of pixels instead of just the one at 8x8?
So i reckon you'd have to edit the texture with lock() and unlock(). Maybe you'd want to make a completely new copy of the texture so that you have the original, unedited texture to fall back on, depending on your needs.
So i reckon you'd have to edit the texture with lock() and unlock(). Maybe you'd want to make a completely new copy of the texture so that you have the original, unedited texture to fall back on, depending on your needs.
you can also define a transparent color and set the pixle at 7,7 (for pixle 8,8 ) to this color (with lock/unlock)...
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
something like this:this is a simple example, but you can play around with it...
Code: Select all
SColor* colMap = (SColor*)theImage->lock();
// assuming the texture is 16x16 and you want pixle at 7,7
colMap[16 * 7 + 7] = SColor(add transparent color here);
theImage->unlock();
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java