mirror of
https://github.com/love2d/love.git
synced 2026-08-15 15:51:12 +02:00
Remove love.graphics.setFont([<file>,] <size>) shorthand, idiom is now love.graphics.newFont([<file>,] <size>):set()
This makes sure that setFont doesn't create any fonts.
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
**/
|
||||
|
||||
// LOVE
|
||||
#include "Graphics.h"
|
||||
#include "wrap_Font.h"
|
||||
|
||||
namespace love
|
||||
@@ -27,6 +28,8 @@ namespace graphics
|
||||
{
|
||||
namespace opengl
|
||||
{
|
||||
extern Graphics * instance;
|
||||
|
||||
Font * luax_checkfont(lua_State * L, int idx)
|
||||
{
|
||||
return luax_checktype<Font>(L, idx, "Font", GRAPHICS_FONT_T);
|
||||
@@ -89,12 +92,20 @@ namespace opengl
|
||||
return 1;
|
||||
}
|
||||
|
||||
int w_Font_set(lua_State * L)
|
||||
{
|
||||
Font * t = luax_checkfont(L, 1);
|
||||
instance->setFont(t);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const luaL_Reg functions[] = {
|
||||
{ "getHeight", w_Font_getHeight },
|
||||
{ "getWidth", w_Font_getWidth },
|
||||
{ "getWrap", w_Font_getWrap },
|
||||
{ "setLineHeight", w_Font_setLineHeight },
|
||||
{ "getLineHeight", w_Font_getLineHeight },
|
||||
{ "set", w_Font_set },
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user