示例#1
0
static int l_freetype_font_new(lua_State *L)
{
    THFreeTypeFont *pFont = luaT_stdnew<THFreeTypeFont>(L, luaT_environindex,
        true);
    l_freetype_throw_error_code(L, pFont->initialise());
    return 1;
}
示例#2
0
static int l_freetype_font_new(lua_State *L)
{
    THFreeTypeFont *pFont = luaT_stdnew<THFreeTypeFont>(L, LUA_ENVIRONINDEX,
        true);
    l_freetype_throw_error_code(L, pFont->initialise());
    return 1;
}
示例#3
0
static int l_freetype_font_set_spritesheet(lua_State *L)
{
    THFreeTypeFont* pFont = luaT_testuserdata<THFreeTypeFont>(L);
    THSpriteSheet* pSheet = luaT_testuserdata<THSpriteSheet>(L, 2);
    lua_settop(L, 2);

    l_freetype_throw_error_code(L, pFont->matchBitmapFont(pSheet));
    lua_settop(L, 1);
    return 1;
}
示例#4
0
static int l_freetype_font_set_face(lua_State *L)
{
    THFreeTypeFont* pFont = luaT_testuserdata<THFreeTypeFont>(L);
    size_t iLength;
    const uint8_t* pData = luaT_checkfile(L, 2, &iLength);
    lua_settop(L, 2);

    l_freetype_throw_error_code(L, pFont->setFace(pData, iLength));
    luaT_setenvfield(L, 1, "face");
    return 1;
}
示例#5
0
static int l_freetype_font_clear_cache(lua_State *L)
{
    THFreeTypeFont* pFont = luaT_testuserdata<THFreeTypeFont>(L);
    pFont->clearCache();
    return 0;
}