Draw Sprites

Nibbie
Posts: 1
Joined: 2008.10
Post: #1
Hi, I'm a independent game developer trying to make my first game for iPhone plataform.

I'm searching for a way to use spritesheets like that:

[Image: sheetwm6.png]

but I haven't find a class or method to draw only a part of a image.

I found a way to get the raster data from the image, but I have to create another image to store the pixels, and it doesn't seems the better approach...

I think it's easy to do so with OpenGL, but 'till now I haven't tried using ES.

Someone has a suggestion, hint or pointer?
Quote this message in a reply
Member
Posts: 241
Joined: 2008.07
Post: #2
You could write a class to manage the cropping of the texture. Load only the specified rectangle into the graphics context and manage it as an independent object.
Quote this message in a reply
Moderator
Posts: 3,571
Joined: 2003.06
Post: #3
For this, I would recommend using OpenGL.
Quote this message in a reply
⌘-R in Chief
Posts: 1,248
Joined: 2002.05
Post: #4
oldrider Wrote:...I haven't find a class or method to draw only a part of a image.

With OpenGL, just use a single texture and change the texture coordinates you use on your quad/triangle strip to match the frame you want to display. There's no specific method or class involved to do it for you. (Though you can certainly wrap all of this functionality into a class...)
Quote this message in a reply
Post Reply