Home  Contents

gcx:play

Graphics Core4 Lua Commands

SYNOPSIS

  1. gcx:play()
  2. gcx:play(dx, dy)
  3. gcx:play(dst)
  4. gcx:play(dst, dx, dy)
  5. gcx:player(...)

DESCRIPTION

The function gcx:play plays the animation stored inside gcx on dst. For default values for all parameters, see gcx:blit. The animation plays independently of the rest of the program flow.

The function gcx:player is similar to gcx:play, but the animation is only initialized and not started yet. Animation playback can be controlled by calling methods on the returned player instance.

Both functions take the same arguments.

RETURN VALUE

Returns an animation player instance. The instance must be stored inside a variable as long as the animation plays, or the garbage collector might throw it away whenever it sees fit. Returns nil if gcx does not contain an animation.

ERRORS

Raises an error if gcx or dst is not a graphics context. If any of the coordinates are out of range, nothing happens.

EXAMPLE

>  >  > 
fb = gfx.open() ani = fb:load("/media/mmc0a/throbber.gif") plr = ani:play(69, 105)

SEE ALSO