Updated 7 November 2026

Sprites

The sprite system (c8b.graphics.sprite, global Sprite) is a Lua class over native sprites: sorting, collision detection and image drawing run natively. Call gfx.sprite.update() once per frame.

Conventions on every page: Availability says whether a symbol exists on the console BIOS, the emulator, or both. c8b and C8B are the same table.

Contents

Creating and managing sprites

c8b.graphics.sprite.new

c8b.graphics.sprite.new([image]) | Sprite([image])

Creates a native sprite, optionally with an image. Subclass with class("Name").extends(Sprite) or Sprite.extends; a sprite is not drawn until :add() is called.

  • Availability: Console (BIOS) and emulator
local s = gfx.sprite.new(gfx.image.new("images/hero"))
s:moveTo(240, 136)
s:add()

c8b.graphics.sprite:add

sprite:add()

Adds the sprite to the display list. If the instance or its class overrides update or draw (or enableCustomUpdate/Draw was called), those Lua callbacks are called by the sprite system.

  • Availability: Console (BIOS) and emulator

c8b.graphics.sprite:addSprite

sprite:addSprite()

Same as :add() (alias).

  • Availability: Console (BIOS) and emulator

c8b.graphics.sprite:remove

sprite:remove()

Removes the sprite from the display list and drops its callback references.

  • Availability: Console (BIOS) and emulator

c8b.graphics.sprite:isAdded

sprite:isAdded()

Whether the sprite is in the display list.

  • Returns: boolean
  • Availability: Console (BIOS) and emulator

c8b.graphics.sprite.update

c8b.graphics.sprite.update([dt])

Static call: updates and draws all sprites (native SpriteManager_updateAndDraw). Call once per frame. When called as an instance method (sprite:update / super.update) it does nothing.

  • Availability: Console (BIOS) and emulator
  • Note: The whole sprite list is redrawn on every call.
function c8b.update()
  gfx.sprite.update()
end

c8b.graphics.sprite.updateAndDraw

c8b.graphics.sprite.updateAndDraw([dt])

Same native call as sprite.update(dt).

  • Availability: Console (BIOS) and emulator

c8b.graphics.sprite.removeAll

c8b.graphics.sprite.removeAll()

Removes every sprite, clears the SDK sprite maps and callback caches and also clears all tilemaps.

  • Availability: Console (BIOS) and emulator

c8b.graphics.sprite.getSpriteCount

c8b.graphics.sprite.getSpriteCount()

Number of sprites in the display list.

  • Returns: integer
  • Availability: Console (BIOS) and emulator

c8b.graphics.sprite.spriteCount

c8b.graphics.sprite.spriteCount()

Alias of getSpriteCount.

  • Returns: integer
  • Availability: Console (BIOS) and emulator

c8b.graphics.sprite.spriteAtPoint

c8b.graphics.sprite.spriteAtPoint(x, y)

Returns the topmost Lua sprite at a point, or nil.

  • Availability: Console (BIOS) and emulator

c8b.graphics.sprite.setAlwaysRedraw

c8b.graphics.sprite.setAlwaysRedraw(flag)

Records the flag only; the renderer always redraws the full frame.

  • Availability: Console (BIOS) and emulator

c8b.graphics.sprite.getAlwaysRedraw

c8b.graphics.sprite.getAlwaysRedraw()

Returns the value recorded by setAlwaysRedraw.

  • Returns: boolean
  • Availability: Console (BIOS) and emulator

c8b.graphics.sprite:markDirty

sprite:markDirty()

No-op (full redraw every frame).

  • Availability: Console (BIOS) and emulator

c8b.graphics.sprite:setOpaque

sprite:setOpaque(flag)

Records the flag only.

  • Availability: Console (BIOS) and emulator

c8b.graphics.sprite:isOpaque

sprite:isOpaque()

Returns the flag recorded by setOpaque.

  • Returns: boolean
  • Availability: Console (BIOS) and emulator

Position and size

c8b.graphics.sprite:moveTo

sprite:moveTo(x, y)

Moves the sprite (its centre point, see setCenter). Assigning sprite.x or sprite.y also calls moveTo.

  • Availability: Console (BIOS) and emulator

c8b.graphics.sprite:moveBy

sprite:moveBy(dx, dy)

Moves the sprite relative to its position.

  • Availability: Console (BIOS) and emulator

c8b.graphics.sprite:getX

sprite:getX()

X position (also readable as sprite.x).

  • Returns: number
  • Availability: Console (BIOS) and emulator

c8b.graphics.sprite:getY

sprite:getY()

Y position (also readable as sprite.y).

  • Returns: number
  • Availability: Console (BIOS) and emulator

c8b.graphics.sprite:getPosition

sprite:getPosition()

Current position.

  • Returns: x, y
  • Availability: Console (BIOS) and emulator

c8b.graphics.sprite:setSize

sprite:setSize(width, height)

Sets the sprite size (also set automatically by setImage).

  • Availability: Console (BIOS) and emulator

c8b.graphics.sprite:getSize

sprite:getSize()

Sprite size.

  • Returns: width, height
  • Availability: Console (BIOS) and emulator

c8b.graphics.sprite:getWidth

sprite:getWidth()

Width (also sprite.width, read-only).

  • Returns: number
  • Availability: Console (BIOS) and emulator

c8b.graphics.sprite:getHeight

sprite:getHeight()

Height (also sprite.height, read-only).

  • Returns: number
  • Availability: Console (BIOS) and emulator

c8b.graphics.sprite:setCenter

sprite:setCenter(x, y)

Sets the anchor point (0..1) used by moveTo.

  • Availability: Console (BIOS) and emulator

c8b.graphics.sprite:setBounds

sprite:setBounds(x, y, width, height)

Sets position and size from a top-left rectangle.

  • Availability: Console (BIOS) and emulator

c8b.graphics.sprite:getBounds

sprite:getBounds()

Draw bounds (not the collide rect).

  • Returns: x, y, width, height
  • Availability: Console (BIOS) and emulator

Appearance

c8b.graphics.sprite:setImage

sprite:setImage(image, [flip])

Sets the image (Image, imagetable frame or anything with a native ref) and resizes the sprite to it; nil clears it. Image sprites are drawn natively.

  • Availability: Console (BIOS) and emulator
  • Note: To scale the sprite, use setScale.

c8b.graphics.sprite:getImage

sprite:getImage()

Returns the image set with setImage.

  • Availability: Console (BIOS) and emulator

c8b.graphics.sprite:setImageFlip

sprite:setImageFlip(flip)

Sets flip (kImageUnflipped/FlippedX/FlippedY/FlippedXY).

  • Availability: Console (BIOS) and emulator

c8b.graphics.sprite:setVisible

sprite:setVisible(visible)

Shows or hides the sprite.

  • Availability: Console (BIOS) and emulator

c8b.graphics.sprite:isVisible

sprite:isVisible()

Visibility.

  • Returns: boolean
  • Availability: Console (BIOS) and emulator

c8b.graphics.sprite:setZIndex

sprite:setZIndex(z)

Draw order (higher draws on top).

  • Availability: Console (BIOS) and emulator

c8b.graphics.sprite:getZIndex

sprite:getZIndex()

Draw order.

  • Returns: integer
  • Availability: Console (BIOS) and emulator

c8b.graphics.sprite:setOpacity

sprite:setOpacity(opacity)

Sets opacity (0.0-1.0) of the sprite image.

  • Availability: Console (BIOS) and emulator

c8b.graphics.sprite:setScale

sprite:setScale(scaleX, [scaleY])

Scales the sprite image (scaleY defaults to scaleX).

  • Availability: Console (BIOS) and emulator

c8b.graphics.sprite:setRotation

sprite:setRotation(degrees)

Rotates the sprite image.

  • Availability: Console (BIOS) and emulator

c8b.graphics.sprite:setIgnoresDrawOffset

sprite:setIgnoresDrawOffset(flag)

When true the sprite is drawn in screen space (HUD).

  • Availability: Console (BIOS) and emulator

c8b.graphics.sprite:getIgnoresDrawOffset

sprite:getIgnoresDrawOffset()

Whether the draw offset is ignored.

  • Returns: boolean
  • Availability: Console (BIOS) and emulator

c8b.graphics.sprite:ignoresDrawOffset

sprite:ignoresDrawOffset()

Same function as getIgnoresDrawOffset.

  • Returns: boolean
  • Availability: Console (BIOS) and emulator

c8b.graphics.sprite:setParallax

sprite:setParallax(x, [y])

Multiplies the draw offset applied to this sprite (y defaults to x).

  • Availability: Console (BIOS) and emulator

c8b.graphics.sprite:getParallax

sprite:getParallax()

Parallax factors.

  • Returns: x, y
  • Availability: Console (BIOS) and emulator

c8b.graphics.sprite:setClipRect

sprite:setClipRect(x, y, width, height)

Stores a clip rect in sprite._clipRect; the renderer does not use it.

  • Availability: Console (BIOS) and emulator

c8b.graphics.sprite:lockFocus

sprite:lockFocus()

Pushes the sprite image as drawing target (see gfx.pushContext).

  • Availability: Console (BIOS) and emulator

c8b.graphics.sprite:unlockFocus

sprite:unlockFocus()

Pops the drawing target.

  • Availability: Console (BIOS) and emulator

Callbacks and custom drawing

c8b.graphics.sprite:update

function MySprite:update() ... end

Callback: override in a subclass or instance; called once per frame for added sprites by sprite.update(). Must be defined before :add() (or call enableCustomUpdate).

  • Availability: Console (BIOS) and emulator

c8b.graphics.sprite:draw

function MySprite:draw(x, y, width, height) ... end

Callback for sprites without an image: called with the screen-space bounds. The base implementation calls the function set with setDrawFunction.

  • Availability: Console (BIOS) and emulator
  • Note: Image sprites draw their image and do not call draw.

c8b.graphics.sprite:setDrawFunction

sprite:setDrawFunction(fn)

Sets fn(x, y, w, h) as the draw callback and enables custom drawing.

  • Availability: Console (BIOS) and emulator

c8b.graphics.sprite:enableCustomDraw

sprite:enableCustomDraw()

Registers the draw callback after :add().

  • Availability: Console (BIOS) and emulator

c8b.graphics.sprite:enableCustomUpdate

sprite:enableCustomUpdate()

Registers the update callback after :add().

  • Availability: Console (BIOS) and emulator

c8b.graphics.sprite:onUpdate

sprite:onUpdate(dt)

Empty method for subclasses to override; it is not called automatically.

  • Availability: Console (BIOS) and emulator

Collisions

c8b.graphics.sprite:setCollideRect

sprite:setCollideRect(x, y, width, height)

Sets the collision rectangle in sprite-local coordinates.

  • Availability: Console (BIOS) and emulator

c8b.graphics.sprite:clearCollideRect

sprite:clearCollideRect()

Removes the collision rectangle.

  • Availability: Console (BIOS) and emulator

c8b.graphics.sprite:hasCollideRect

sprite:hasCollideRect()

Whether a collide rect is set.

  • Returns: boolean
  • Availability: Console (BIOS) and emulator

c8b.graphics.sprite:getCollideBounds

sprite:getCollideBounds()

Collide rect in world coordinates.

  • Returns: x, y, width, height
  • Availability: Console (BIOS) and emulator
  • Note: Returns four numbers, not a rect.

c8b.graphics.sprite:setCollisionResponse

sprite:setCollisionResponse(type)

Default response type (kCollisionType*) used when collisionResponse is not overridden.

  • Availability: Console (BIOS) and emulator

c8b.graphics.sprite:collisionResponse

function MySprite:collisionResponse(other) return "slide" end

Callback: return "slide", "freeze", "overlap", "bounce" or a kCollisionType number; nil means slide.

  • Availability: Console (BIOS) and emulator

c8b.graphics.sprite:setCollisionResponseFunc

sprite:setCollisionResponseFunc(fn)

Stores fn in sprite._collisionResponseFunc and marks the sprite as having a custom response. The stored function itself is not called by the SDK; override collisionResponse instead.

  • Availability: Console (BIOS) and emulator

c8b.graphics.sprite:hasCustomCollisionResponse

sprite:hasCustomCollisionResponse()

Whether setCollisionResponseFunc was given a function.

  • Returns: boolean
  • Availability: Console (BIOS) and emulator

c8b.graphics.sprite:moveWithCollisions

sprite:moveWithCollisions(goalX, goalY)

Moves toward the goal resolving collisions natively (calls collisionResponse when overridden).

  • Returns: actualX, actualY, collisions, count โ€” each collision is {sprite, other, type, normalX, normalY, normal={x,y}}
  • Availability: Console (BIOS) and emulator
  • Note: Takes numbers, not a point.
local x, y, cols, n = player:moveWithCollisions(px + vx, py + vy)

c8b.graphics.sprite:checkCollisions

sprite:checkCollisions(goalX, goalY) | (point)

Same result as moveWithCollisions but the sprite stays where it is.

  • Returns: actualX, actualY, collisions, count
  • Availability: Console (BIOS) and emulator

c8b.graphics.sprite:overlappingSprites

sprite:overlappingSprites()

Lua sprites overlapping this one.

  • Returns: table
  • Availability: Console (BIOS) and emulator

c8b.graphics.sprite:isOverlapping

sprite:isOverlapping()

Whether anything overlaps this sprite.

  • Returns: boolean
  • Availability: Console (BIOS) and emulator

c8b.graphics.sprite:setCollisionsEnabled

sprite:setCollisionsEnabled(enabled)

Disabling saves and clears the collide rect; enabling restores it.

  • Availability: Console (BIOS) and emulator

c8b.graphics.sprite:isCollisionsEnabled

sprite:isCollisionsEnabled()

Whether collisions are enabled.

  • Returns: boolean
  • Availability: Console (BIOS) and emulator

c8b.graphics.sprite:setGroups

sprite:setGroups(groups)

Collision groups: a table of group numbers (1..32) or one number.

  • Availability: Console (BIOS) and emulator
  • Note: Pass a table of group numbers, for example {1, 3}. A single number is read as a group number by the emulator and as a bitmask by the console.

c8b.graphics.sprite:setCollidesWithGroups

sprite:setCollidesWithGroups(groups)

Groups this sprite collides with (same argument forms and same platform difference as setGroups).

  • Availability: Console (BIOS) and emulator

c8b.graphics.sprite:setGroupMask

sprite:setGroupMask(mask)

Sets the raw 32-bit group mask (bit n-1 = group n).

  • Availability: Emulator only
  • Note: Not available on the console or when the emulator boots from an SD-card folder.

c8b.graphics.sprite:setCollidesWithGroupsMask

sprite:setCollidesWithGroupsMask(mask)

Raw 32-bit collides-with mask.

  • Availability: Emulator only
  • Note: Not available on the console or when the emulator boots from an SD-card folder.

c8b.graphics.sprite:setStatic

sprite:setStatic(flag)

Marks the sprite as static for the collision broad phase.

  • Availability: Console (BIOS) and emulator

c8b.graphics.sprite:isStatic

sprite:isStatic()

Static flag.

  • Returns: boolean
  • Availability: Console (BIOS) and emulator

c8b.graphics.sprite:setTag

sprite:setTag(tag)

Sets a number tag; a string is hashed natively and returned as the string by getTag.

  • Availability: Console (BIOS) and emulator

c8b.graphics.sprite:getTag

sprite:getTag()

Tag (string if a string was set).

  • Availability: Console (BIOS) and emulator

c8b.graphics.sprite:getId

sprite:getId()

Native sprite id.

  • Returns: integer
  • Availability: Console (BIOS) and emulator

c8b.graphics.sprite.addEmptyCollisionSprite

c8b.graphics.sprite.addEmptyCollisionSprite(x, y, width, height)

Creates and adds an invisible sprite whose collide rect covers the rectangle.

  • Returns: sprite
  • Availability: Console (BIOS) and emulator

c8b.graphics.sprite.addWallSprites

c8b.graphics.sprite.addWallSprites(tilemap, [emptyIDs])

Creates collision sprites from tilemap:getCollisionRects(emptyIDs).

  • Returns: table of sprites
  • Availability: Console (BIOS) and emulator

c8b.graphics.sprite.kCollisionTypeSlide

c8b.graphics.sprite.kCollisionTypeSlide = 1

Collision response type.

  • Availability: Console (BIOS) and emulator
  • Note: collisionResponse may also return the strings "slide", "freeze", "overlap" or "bounce".

c8b.graphics.sprite.kCollisionTypeFreeze

c8b.graphics.sprite.kCollisionTypeFreeze = 2

Collision response type.

  • Availability: Console (BIOS) and emulator
  • Note: collisionResponse may also return the strings "slide", "freeze", "overlap" or "bounce".

c8b.graphics.sprite.kCollisionTypeOverlap

c8b.graphics.sprite.kCollisionTypeOverlap = 3

Collision response type.

  • Availability: Console (BIOS) and emulator
  • Note: collisionResponse may also return the strings "slide", "freeze", "overlap" or "bounce".

c8b.graphics.sprite.kCollisionTypeBounce

c8b.graphics.sprite.kCollisionTypeBounce = 4

Collision response type.

  • Availability: Console (BIOS) and emulator
  • Note: collisionResponse may also return the strings "slide", "freeze", "overlap" or "bounce".

Aliases

Sprite

Sprite

Global alias of c8b.graphics.sprite (the Sprite class).

  • Availability: Console (BIOS) and emulator

Low-level bindings (C8B.*)

C8B.Sprite_add

C8B.Sprite_add(sprite)

Native sprite binding: add.

  • Availability: Console (BIOS) and emulator

C8B.Sprite_new

C8B.Sprite_new()

Native sprite binding: new.

  • Returns: 1 value(s): handle, nil
  • Availability: Console (BIOS) and emulator

C8B.Sprite_free

C8B.Sprite_free(sprite)

Native sprite binding: free.

  • Availability: Console (BIOS) and emulator

C8B.Sprite_getX

C8B.Sprite_getX(sprite)

Native sprite binding: get x.

  • Returns: 1 value(s): number
  • Availability: Console (BIOS) and emulator

C8B.Sprite_getY

C8B.Sprite_getY(sprite)

Native sprite binding: get y.

  • Returns: 1 value(s): number
  • Availability: Console (BIOS) and emulator

C8B.Sprite_getId

C8B.Sprite_getId(sprite)

Native sprite binding: get id.

  • Returns: 1 value(s): integer
  • Availability: Console (BIOS) and emulator

C8B.Sprite_getTag

C8B.Sprite_getTag(sprite)

Native sprite binding: get tag.

  • Returns: 1 value(s): integer
  • Availability: Console (BIOS) and emulator

C8B.Sprite_moveBy

C8B.Sprite_moveBy(sprite, dx, dy)

Native sprite binding: move by.

  • Availability: Console (BIOS) and emulator

C8B.Sprite_moveTo

C8B.Sprite_moveTo(sprite, x, y)

Native sprite binding: move to.

  • Availability: Console (BIOS) and emulator

C8B.Sprite_remove

C8B.Sprite_remove(sprite)

Native sprite binding: remove.

  • Availability: Console (BIOS) and emulator

C8B.Sprite_setTag

C8B.Sprite_setTag(sprite, tag)

Native sprite binding: set tag.

  • Availability: Console (BIOS) and emulator

C8B.Sprite_isAdded

C8B.Sprite_isAdded(sprite)

Native sprite binding: is added.

  • Returns: 1 value(s): boolean
  • Availability: Console (BIOS) and emulator

C8B.Sprite_setSize

C8B.Sprite_setSize(sprite, width, height)

Native sprite binding: set size.

  • Availability: Console (BIOS) and emulator

C8B.Sprite_drawSelf

C8B.Sprite_drawSelf(sprite)

Draws the sprite image now.

  • Availability: Console (BIOS) and emulator

C8B.Sprite_getWidth

C8B.Sprite_getWidth(sprite)

Native sprite binding: get width.

  • Returns: 1 value(s): number
  • Availability: Console (BIOS) and emulator

C8B.Sprite_hasImage

C8B.Sprite_hasImage(sprite)

Whether the sprite has an image.

  • Returns: 1 value(s): boolean
  • Availability: Console (BIOS) and emulator

C8B.Sprite_isStatic

C8B.Sprite_isStatic(sprite)

Native sprite binding: is static.

  • Returns: 1 value(s): boolean
  • Availability: Console (BIOS) and emulator

C8B.Sprite_setImage

C8B.Sprite_setImage(sprite, imagePtr)

Native sprite binding: set image.

  • Availability: Console (BIOS) and emulator

C8B.Sprite_setScale

C8B.Sprite_setScale(sprite, scaleX, scaleY)

Native sprite binding: set scale.

  • Availability: Console (BIOS) and emulator

C8B.Sprite_getBounds

C8B.Sprite_getBounds(sprite)

Native sprite binding: get bounds.

  • Returns: 4 value(s): number
  • Availability: Console (BIOS) and emulator

C8B.Sprite_getHeight

C8B.Sprite_getHeight(sprite)

Native sprite binding: get height.

  • Returns: 1 value(s): number
  • Availability: Console (BIOS) and emulator

C8B.Sprite_getZIndex

C8B.Sprite_getZIndex(sprite)

Native sprite binding: get zindex.

  • Returns: 1 value(s): integer
  • Availability: Console (BIOS) and emulator

C8B.Sprite_isVisible

C8B.Sprite_isVisible(sprite)

Native sprite binding: is visible.

  • Returns: 1 value(s): boolean
  • Availability: Console (BIOS) and emulator

C8B.Sprite_setBounds

C8B.Sprite_setBounds(sprite, x, y, w, h)

Native sprite binding: set bounds.

  • Availability: Console (BIOS) and emulator

C8B.Sprite_setCenter

C8B.Sprite_setCenter(sprite, x, y)

Native sprite binding: set center.

  • Availability: Console (BIOS) and emulator

C8B.Sprite_setGroups

C8B.Sprite_setGroups(sprite, groups)

Native sprite binding: set groups.

  • Availability: Console (BIOS) and emulator

C8B.Sprite_setStatic

C8B.Sprite_setStatic(sprite, isStatic)

Native sprite binding: set static.

  • Availability: Console (BIOS) and emulator

C8B.Sprite_setZIndex

C8B.Sprite_setZIndex(sprite, z)

Native sprite binding: set zindex.

  • Availability: Console (BIOS) and emulator

C8B.Sprite_setOpacity

C8B.Sprite_setOpacity(sprite, opacity)

Native sprite binding: set opacity.

  • Availability: Console (BIOS) and emulator

C8B.Sprite_setVisible

C8B.Sprite_setVisible(sprite, visible)

Native sprite binding: set visible.

  • Availability: Console (BIOS) and emulator

C8B.SpriteManager_draw

C8B.SpriteManager_draw()

Draws all sprites.

  • Availability: Console (BIOS) and emulator

C8B.Sprite_setParallax

C8B.Sprite_setParallax(sprite, parallaxX, parallaxY)

Native sprite binding: set parallax.

  • Availability: Console (BIOS) and emulator

C8B.Sprite_setRotation

C8B.Sprite_setRotation(sprite, degrees)

Native sprite binding: set rotation.

  • Availability: Console (BIOS) and emulator

C8B.Sprite_getParallaxX

C8B.Sprite_getParallaxX(sprite)

Native sprite binding: get parallax x.

  • Returns: 1 value(s): number
  • Availability: Console (BIOS) and emulator

C8B.Sprite_getParallaxY

C8B.Sprite_getParallaxY(sprite)

Native sprite binding: get parallax y.

  • Returns: 1 value(s): number
  • Availability: Console (BIOS) and emulator

C8B.Sprite_newWithImage

C8B.Sprite_newWithImage(imagePtr)

Native sprite binding: new with image.

  • Returns: 1 value(s): handle, nil
  • Availability: Console (BIOS) and emulator

C8B.Sprite_setImageFlip

C8B.Sprite_setImageFlip(sprite, flip)

Native sprite binding: set image flip.

  • Availability: Console (BIOS) and emulator

C8B.SpriteManager_update

C8B.SpriteManager_update(dt)

Runs sprite update callbacks.

  • Availability: Console (BIOS) and emulator

C8B.Sprite_isOverlapping

C8B.Sprite_isOverlapping(sprite)

Native sprite binding: is overlapping.

  • Returns: 1 value(s): boolean
  • Availability: Console (BIOS) and emulator

C8B.Sprite_hasCollideRect

C8B.Sprite_hasCollideRect(sprite)

Native sprite binding: has collide rect.

  • Returns: 1 value(s): boolean
  • Availability: Console (BIOS) and emulator

C8B.Sprite_setCollideRect

C8B.Sprite_setCollideRect(sprite, x, y, w, h)

Native sprite binding: set collide rect.

  • Availability: Console (BIOS) and emulator

C8B.Sprite_clearCollideRect

C8B.Sprite_clearCollideRect(sprite)

Native sprite binding: clear collide rect.

  • Availability: Console (BIOS) and emulator

C8B.Sprite_getCollideBounds

C8B.Sprite_getCollideBounds(sprite)

Native sprite binding: get collide bounds.

  • Returns: 4 value(s): number
  • Availability: Console (BIOS) and emulator

C8B.Sprite_hasDynamicResponse

C8B.Sprite_hasDynamicResponse(sprite)

Dynamic-response flag.

  • Returns: 1 value(s): boolean
  • Availability: Console (BIOS) and emulator

C8B.Sprite_moveWithCollisions

C8B.Sprite_moveWithCollisions(sprite, goalX, goalY)

Moves resolving collisions.

  • Returns: 4 value(s): handle, integer, number
  • Availability: Console (BIOS) and emulator

C8B.Sprite_overlappingSprites

C8B.Sprite_overlappingSprites(sprite)

Count and table of overlapping sprite pointers.

  • Returns: 2 value(s): handle, integer
  • Availability: Console (BIOS) and emulator

C8B.SpriteManager_spriteAtPoint

C8B.SpriteManager_spriteAtPoint(x, y)

Native sprite manager binding: sprite at point.

  • Returns: 1 value(s): handle, nil
  • Availability: Console (BIOS) and emulator

C8B.SpriteManager_updateAndDraw

C8B.SpriteManager_updateAndDraw(dt)

Update and draw all sprites (used by sprite.update).

  • Availability: Console (BIOS) and emulator

C8B.Sprite_getIgnoresDrawOffset

C8B.Sprite_getIgnoresDrawOffset(sprite)

Native sprite binding: get ignores draw offset.

  • Returns: 1 value(s): boolean
  • Availability: Console (BIOS) and emulator

C8B.Sprite_moveWithCollisionsEx

C8B.Sprite_moveWithCollisionsEx(sprite, goalX, goalY)

Moves resolving collisions; also returns per-collision types and normals.

  • Returns: 7 value(s): handle, integer, number
  • Availability: Console (BIOS) and emulator

C8B.Sprite_setCollisionResponse

C8B.Sprite_setCollisionResponse(sprite, type)

Native sprite binding: set collision response.

  • Availability: Console (BIOS) and emulator

C8B.Sprite_setIgnoresDrawOffset

C8B.Sprite_setIgnoresDrawOffset(sprite, ignores)

Native sprite binding: set ignores draw offset.

  • Availability: Console (BIOS) and emulator

C8B.SpriteManager_getSpriteCount

C8B.SpriteManager_getSpriteCount()

Native sprite manager binding: get sprite count.

  • Returns: 1 value(s): integer
  • Availability: Console (BIOS) and emulator

C8B.Sprite_setCollidesWithGroups

C8B.Sprite_setCollidesWithGroups(sprite, groups)

Native sprite binding: set collides with groups.

  • Availability: Console (BIOS) and emulator

C8B.Sprite_setHasDynamicResponse

C8B.Sprite_setHasDynamicResponse(sprite, dynamic)

Flags the sprite so collisions call the Lua collisionResponse.

  • Availability: Console (BIOS) and emulator

C8B.SpriteManager_removeAllSprites

C8B.SpriteManager_removeAllSprites()

Native sprite manager binding: remove all sprites.

  • Availability: Console (BIOS) and emulator

C8B.Sprite_findPotentialCollisions

C8B.Sprite_findPotentialCollisions(sprite, goalX, goalY)

Sprites the move would touch (broad phase).

  • Returns: 2 value(s): handle, integer
  • Availability: Console (BIOS) and emulator

C8B.Sprite_moveWithCollisionsDynamic

C8B.Sprite_moveWithCollisionsDynamic(sprite, goalX, goalY)

Like Ex, but consults Lua collisionResponse for sprites flagged with setHasDynamicResponse.

  • Returns: 7 value(s): handle, integer, number
  • Availability: Console (BIOS) and emulator

C8B.Sprite_moveWithCollisionsFiltered

C8B.Sprite_moveWithCollisionsFiltered(sprite, goalX, goalY, tableLen)

Like Ex, ignoring the sprites listed in the table argument.

  • Returns: 7 value(s): handle, integer, number
  • Availability: Console (BIOS) and emulator