Page 6 of 6

Re: Easy GL2D

Posted: Thu Sep 13, 2012 3:40 pm
by slenkar
yep, im using that technique to animate human characters

On other platforms Im used to drawing for example, the torso, then saving its matrix values e.g.(1,0,0,1,50,40)

Then when I am ready to draw a limb I load the torso's matrix (glLoadMatrix) and rotate and translate for each limb.

Maybe I could use Push and PopMatrix instead.(like your tentacle example)

glSpriteOnQuad seems to be the best command because an arm for example has to have its origin or 'handle' at the shoulder so it rotates from the shoulder.
glSpriteOnQuad could also be used to draw isometric tiles, the diamond shaped ones, from a square texture.

Re: Easy GL2D

Posted: Thu Sep 13, 2012 4:16 pm
by slenkar
by the way how do you set magenta as the clear color?

I can only see GL_TEXTURE_COLOR0_TRANSPARENT which uses black
the texture packer uses magenta

I tried deleting GL_TEXTURE_COLOR0_TRANSPARENT from the source and put -gT #FF00FF into the GRIT file but it didnt help

Re: Easy GL2D

Posted: Thu Sep 13, 2012 7:13 pm
by slenkar
even if I set my png's background to 0,0,0 black and put the GL_TEXTURE_COLOR0_TRANSPARENT enum back into the sourcecode black is still not transparent

Re: Easy GL2D

Posted: Thu Sep 13, 2012 7:25 pm
by elhobbs
GL_TEXTURE_COLOR0_TRANSPARENT indicates that paletted textures that specify index 0 in the image data should be transparent for that pixel - in other words it ignores the color value at index 0 in the palette and does not draw the pixels that reference this palette index.

Re: Easy GL2D

Posted: Thu Sep 13, 2012 8:28 pm
by slenkar
aha ok, so how do I, get magenta to be transparent

or how do I get magenta to be the first color in the palette?

Re: Easy GL2D

Posted: Thu Sep 13, 2012 8:41 pm
by elhobbs
I am not really a grit expert, but

Code: Select all

-gT FF00FF
should do it

Re: Easy GL2D

Posted: Thu Sep 13, 2012 9:18 pm
by slenkar
it worked! thanks,
I turned my bitmap into an indexed image used magenta as the background and added the flag and this time it worked,