Achieve sprite sheet texture mapping without using P2D/P3D

edited March 2017 in Questions about Code

Hi, I have a sprite sheet image that I load as a texture and display different subsections of the image with a combination of texture() and vertex(). Example:

size(480,320,P2D)
beginShape()
texture(...)
vertex(x,y,nx,ny)
vertex(x,y,nx,ny)
vertex(x,y,nx,ny)
vertex(x,y,nx,ny)
endShape()

The problem is I am now trying to run the sketch on a video device which doesn't have OpenGL (a Linux framebuffer) so I can't use P2D anymore. How can I achieve this same effect (drawing "windows" into a sprite sheet) without texture()?

Would prefer not to split the spritesheet into hundreds of files if possible.

Tagged:

Answers

Sign In or Register to comment.