From d2058dce75ceb67f27c50e9f27d755a4d30c9003 Mon Sep 17 00:00:00 2001 From: chai Date: Tue, 13 Nov 2018 21:33:25 +0800 Subject: =?UTF-8?q?*=E4=BF=AE=E6=94=B9=E6=B8=B2=E6=9F=93=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lua/modules/graphics/je_lua_ttf.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/lua/modules/graphics/je_lua_ttf.cpp') diff --git a/src/lua/modules/graphics/je_lua_ttf.cpp b/src/lua/modules/graphics/je_lua_ttf.cpp index 4e47906..31af310 100644 --- a/src/lua/modules/graphics/je_lua_ttf.cpp +++ b/src/lua/modules/graphics/je_lua_ttf.cpp @@ -2,6 +2,7 @@ #include "lua/modules/types.h" #include "lua/common/je_lua_common.h" #include "libjin/jin.h" +#include "je_lua_ttf.h" using namespace JinEngine::Graphics; using namespace JinEngine::Graphics::Fonts; @@ -11,6 +12,28 @@ namespace JinEngine namespace Lua { + ////////////////////////////////////////////////////////////////////////////////////////////////////////// + // TTFData + ////////////////////////////////////////////////////////////////////////////////////////////////////////// + + TTF* TTFData::createTTF(unsigned fontSize) + { + TTF* ttf; + try + { + ttf = new TTF(this, fontSize); + } + catch (...) + { + return nullptr; + } + return ttf; + } + + ////////////////////////////////////////////////////////////////////////////////////////////////////////// + // TTF + ////////////////////////////////////////////////////////////////////////////////////////////////////////// + LUA_IMPLEMENT int l_gc(lua_State* L) { Proxy* proxy = (Proxy*)luax_checktype(L, 1, JIN_GRAPHICS_TTF); -- cgit v1.1-26-g67d0