It looks like you're new here. If you want to get involved, click one of these buttons!
i'm using some sprite sheets in my little dungeon demo. i do them by copying from the sheet image into smaller individual images. as far as i know, that's the thing to do in codea for now.
i know we're all about 3d and shaders these days, but it would be nice to have an additional drawing operation like sprite that included the cropping values right in the command, esp if it could work with a blit right to the screen rather than making an explicit copy.
just an idea ...
Comments
you can use mesh to use a sprite sheet, although i recall reading somewhere here that mesh is going to be deprecated in C4 (why ??):
this assumes you will have the same rectangular bounding box for each image in your sheet, if you want to handle packed sprite sheets you will need to include the data for each bounding box x,y,w, and h and figure out the values needed in setRectTex
@skar the functionality of mesh will still exist in Codea 4, but the specific mesh related APIs will be superseded by something better
interesting, @skar ... i'll have to figure that out, looks like it might do what i'm thinking. thanks!
@skar got it, thanks!
needed an addRect. can't setRect a non-existing rect
@Simeon will this break compatibility with the old code sharing posts on the forums? They are a rich source of learning...
@RonJeffries
ahh my bad, i addRect in another class that i use for holding a physics body and mesh together, maybe it's better to put that into the init but maybe there was a reason i can't remember now that i didn't