LuaBox
Loading...
Searching...
No Matches
Gif.h File Reference
#include "lua_include.h"
#include "global.h"
#include "../gif.h"

Go to the source code of this file.

Functions

int GifCreate (lua_State *L)
 Create a new GIF object.
int GifPlayAsync (lua_State *L)
 Play the GIF asynchronously.
int GifStop (lua_State *L)
 Stop the GIF playback.
void RegisterGifLua (lua_State *L)

Function Documentation

◆ GifCreate()

int GifCreate ( lua_State * L)

Create a new GIF object.

Parameters
LLua state; expects arguments: 1: path (const char*) – path to the GIF file, 2: x (int) – X position on screen, 3: y (int) – Y position on screen.
Returns
int Pushes 1 userdata to Lua stack: a LuaGif object.
Note
Allocates memory for a new Gif instance and wraps it as Lua userdata.

◆ GifPlayAsync()

int GifPlayAsync ( lua_State * L)

Play the GIF asynchronously.

Parameters
LLua state; expects argument: 1: LuaGif userdata created by GifCreate.
Returns
int Returns 0; starts GIF playback in async mode.
Note
Call this on a LuaGif object to start animation without blocking the main thread.

◆ GifStop()

int GifStop ( lua_State * L)

Stop the GIF playback.

Parameters
LLua state; expects argument: 1: LuaGif userdata created by GifCreate.
Returns
int Returns 0; stops the GIF playback.
Note
Call this on a LuaGif object to immediately halt animation.

◆ RegisterGifLua()

void RegisterGifLua ( lua_State * L)