Next: , Previous: , Up: Rendering   [Contents][Index]


4.5.2 Sprites

Scheme Procedure: make-sprite texture [#:anchor]

Create a sprite that displays the image in texture. The size of the mesh is the size of texture in pixels. anchor defines the origin of the sprite. By default, the anchor is center, which puts the origin in the middle of the sprite. See ’anchor-texture’ for more anchoring options.

Scheme Procedure: load-sprite file [#:anchor]

Create a sprite from the texture in file whose origin is defined by anchor. The default anchor is center.

Scheme Syntax: sprite? obj

Return #t if obj is a sprite.

Scheme Syntax: sprite-texture sprite

Return the texture for sprite.

Scheme Syntax: sprite-mesh mesh

Return the mesh for sprite.

Scheme Procedure: render-sprite sprite

Create a renderer for sprite.