chickadee » hypergiant » make-sprite-sheet

(make-sprite-sheet TEX-WIDTH TEX-HEIGHT FRAME-WIDTH FRAME-HEIGHT [rows: ROWS] [columns: COLUMNS] [x-offset: X-OFFSET] [y-offset: Y-OFFSET] [centered?: CENTERED?] [texture-type: TEXTURE-TYPE])procedure

Return a mesh, similar to a rectangular mesh, but with multiple rectangles with different texture coordinates. The rectangles will be sized FRAME-WIDTH by FRAME-HEIGHT. If CENTERED? is not #f, the centre of the rectangles with be at the origin, otherwise the bottom left corner will be (default is #t). The texture coordinates will be taken as though the rectangles were arranged in a grid over a texture of dimensions TEX-WIDTH by TEX-HEIGHT, with the number of rows and columns that can fit on these dimensions, unless ROWS or COLUMNS is specified. Offsets to the top left corner of the tiled area of the texture can be provided with X-OFFSET and Y-OFFSET. TEXTURE-TYPE controls the in-memory type of the texture attribute, and should be a valid argument to type->gl, defaulting to #:ushort.

The meshes returned by make-sprite-sheet are intended as an argument to make-animated-sprite or add-new-animated-sprite. A single sprite sheet cannot be used with animated sprites with different textures. Consider using mesh-copy if you need an identical sprite sheet.