Looking for guidance

support for the powerpc toolchain
Post Reply
psycorpse
Posts: 9
Joined: Sun Sep 13, 2009 6:37 pm
Location: St Louis, MO USA
Contact:

Looking for guidance

Post by psycorpse » Wed Apr 17, 2013 7:19 pm

I am picking wii dev back up and it has been a long time. Not that I was good back then however I am attempting to get into using libogc and gx (maybe the same?). I can get sprites to the screen with no problem however I am looking to implement fading on the sprites. How might I do this and or where can I read about it. I have seen the doxygen docs however I don't even know what I am looking for. If there is some likeness between opengl and gx and there is a good book that you can recommend that would be great too.

Thanks,
Mike
Currently doing 3ds game programming!
Website: http://www.stlwd.com

psycorpse
Posts: 9
Joined: Sun Sep 13, 2009 6:37 pm
Location: St Louis, MO USA
Contact:

Re: Looking for guidance

Post by psycorpse » Tue Apr 23, 2013 8:40 pm

Well just for future reference I think I have figured it out. At least it is working for me. If I am doing something wrong feel free to let me know.

In the Draw Method you will need to switch the TEVSTAGE to MODULATE and in your GX_Color4u8(r, g, b, a) the a will control the transparency on the object that you are drawing.

Note: alpha is a value between 0 and 255 (255 fully visible and 0 fully transparent)

Here is a snip of my draw code.

Code: Select all

// SNIP
GX_SetTevOp(GX_TEVSTAGE0, GX_MODULATE);

GX_Begin(GX_QUADS, GX_VTXFMT0, 4);
  GX_Position2f32(x, y);
  GX_Color4u8(255, 255, 255, alpha); // Use white as it will not tint the texture
  GX_TexCoord2f32(tex_x, tex_y);

  GX_Position2f32(x + w, y);
  GX_Color4u8(255, 255, 255, alpha); // Use white as it will not tint the texture
  GX_TexCoord2f32(tex_x + tex_w, tex_y);

  GX_Position2f32(x + w , y + h);
  GX_Color4u8(255, 255, 255, alpha); // Use white as it will not tint the texture
  GX_TexCoord2f32(tex_x + tex_w, tex_y + tex_h);

  GX_Position2f32(x, y + h);
  GX_Color4u8(255, 255, 255, alpha); // Use white as it will not tint the texture
  GX_TexCoord2f32(tex_x, tex_y + tex_h);
GX_End();

// End SNIP
Currently doing 3ds game programming!
Website: http://www.stlwd.com

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 11 guests