mirror of
https://github.com/love2d/love.git
synced 2026-08-18 03:34:23 +02:00
merge
This commit is contained in:
@@ -195,7 +195,7 @@ namespace opengl
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int w_newFont(lua_State * L)
|
int w_newFont1(lua_State * L)
|
||||||
{
|
{
|
||||||
Data * d = 0;
|
Data * d = 0;
|
||||||
|
|
||||||
@@ -320,7 +320,7 @@ namespace opengl
|
|||||||
return 4;
|
return 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
int w_setFont(lua_State * L)
|
int w_setFont1(lua_State * L)
|
||||||
{
|
{
|
||||||
// The second parameter is an optional int.
|
// The second parameter is an optional int.
|
||||||
int size = luaL_optint(L, 2, 12);
|
int size = luaL_optint(L, 2, 12);
|
||||||
@@ -787,7 +787,7 @@ namespace opengl
|
|||||||
{ "newImage", w_newImage },
|
{ "newImage", w_newImage },
|
||||||
{ "newGlyph", w_newGlyph },
|
{ "newGlyph", w_newGlyph },
|
||||||
{ "newQuad", w_newQuad },
|
{ "newQuad", w_newQuad },
|
||||||
{ "newFont", w_newFont },
|
{ "newFont1", w_newFont1 },
|
||||||
{ "newImageFont", w_newImageFont },
|
{ "newImageFont", w_newImageFont },
|
||||||
{ "newSpriteBatch", w_newSpriteBatch },
|
{ "newSpriteBatch", w_newSpriteBatch },
|
||||||
{ "newParticleSystem", w_newParticleSystem },
|
{ "newParticleSystem", w_newParticleSystem },
|
||||||
@@ -797,7 +797,7 @@ namespace opengl
|
|||||||
{ "setBackgroundColor", w_setBackgroundColor },
|
{ "setBackgroundColor", w_setBackgroundColor },
|
||||||
{ "getBackgroundColor", w_getBackgroundColor },
|
{ "getBackgroundColor", w_getBackgroundColor },
|
||||||
|
|
||||||
{ "setFont", w_setFont },
|
{ "setFont1", w_setFont1 },
|
||||||
{ "getFont", w_getFont },
|
{ "getFont", w_getFont },
|
||||||
|
|
||||||
{ "setBlendMode", w_setBlendMode },
|
{ "setBlendMode", w_setBlendMode },
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ namespace opengl
|
|||||||
int w_newImage(lua_State * L);
|
int w_newImage(lua_State * L);
|
||||||
int w_newGlyph(lua_State * L);
|
int w_newGlyph(lua_State * L);
|
||||||
int w_newFrame(lua_State * L);
|
int w_newFrame(lua_State * L);
|
||||||
int w_newFont(lua_State * L);
|
int w_newFont1(lua_State * L);
|
||||||
int w_newImageFont(lua_State * L);
|
int w_newImageFont(lua_State * L);
|
||||||
int w_newSpriteBatch(lua_State * L);
|
int w_newSpriteBatch(lua_State * L);
|
||||||
int w_newParticleSystem(lua_State * L);
|
int w_newParticleSystem(lua_State * L);
|
||||||
@@ -60,7 +60,7 @@ namespace opengl
|
|||||||
int w_getColor(lua_State * L);
|
int w_getColor(lua_State * L);
|
||||||
int w_setBackgroundColor(lua_State * L);
|
int w_setBackgroundColor(lua_State * L);
|
||||||
int w_getBackgroundColor(lua_State * L);
|
int w_getBackgroundColor(lua_State * L);
|
||||||
int w_setFont(lua_State * L);
|
int w_setFont1(lua_State * L);
|
||||||
int w_getFont(lua_State * L);
|
int w_getFont(lua_State * L);
|
||||||
int w_setBlendMode(lua_State * L);
|
int w_setBlendMode(lua_State * L);
|
||||||
int w_setColorMode(lua_State * L);
|
int w_setColorMode(lua_State * L);
|
||||||
|
|||||||
@@ -18,6 +18,22 @@ freely, subject to the following restrictions:
|
|||||||
3. This notice may not be removed or altered from any source distribution.
|
3. This notice may not be removed or altered from any source distribution.
|
||||||
--]]
|
--]]
|
||||||
|
|
||||||
|
function love.graphics.newFont(font, size)
|
||||||
|
if type(font) == "number" then
|
||||||
|
size = font
|
||||||
|
font = love._vera_ttf
|
||||||
|
end
|
||||||
|
return love.graphics.newFont1(font, size)
|
||||||
|
end
|
||||||
|
|
||||||
|
love.graphics.setFont = function(font, size)
|
||||||
|
if type(font) == "number" then
|
||||||
|
size = font
|
||||||
|
font = love._vera_ttf
|
||||||
|
end
|
||||||
|
return love.graphics.setFont1(font, size)
|
||||||
|
end
|
||||||
|
|
||||||
love.graphics.print = function (...)
|
love.graphics.print = function (...)
|
||||||
if not love.graphics.getFont() then
|
if not love.graphics.getFont() then
|
||||||
love.graphics.setFont(love._vera_ttf, 12)
|
love.graphics.setFont(love._vera_ttf, 12)
|
||||||
|
|||||||
+51
-27
@@ -83,35 +83,59 @@ const char graphics_lua[] =
|
|||||||
0x65,0x6D,0x6F,0x76,0x65,0x64,0x20,0x6F,0x72,0x20,0x61,0x6C,0x74,0x65,0x72,
|
0x65,0x6D,0x6F,0x76,0x65,0x64,0x20,0x6F,0x72,0x20,0x61,0x6C,0x74,0x65,0x72,
|
||||||
0x65,0x64,0x20,0x66,0x72,0x6F,0x6D,0x20,0x61,0x6E,0x79,0x20,0x73,0x6F,0x75,
|
0x65,0x64,0x20,0x66,0x72,0x6F,0x6D,0x20,0x61,0x6E,0x79,0x20,0x73,0x6F,0x75,
|
||||||
0x72,0x63,0x65,0x20,0x64,0x69,0x73,0x74,0x72,0x69,0x62,0x75,0x74,0x69,0x6F,
|
0x72,0x63,0x65,0x20,0x64,0x69,0x73,0x74,0x72,0x69,0x62,0x75,0x74,0x69,0x6F,
|
||||||
0x6E,0x2E,0x0D,0x0A,0x2D,0x2D,0x5D,0x5D,0x0D,0x0A,0x0D,0x0A,0x6C,0x6F,0x76,
|
0x6E,0x2E,0x0D,0x0A,0x2D,0x2D,0x5D,0x5D,0x0D,0x0A,0x0D,0x0A,0x66,0x75,0x6E,
|
||||||
0x65,0x2E,0x67,0x72,0x61,0x70,0x68,0x69,0x63,0x73,0x2E,0x70,0x72,0x69,0x6E,
|
0x63,0x74,0x69,0x6F,0x6E,0x20,0x6C,0x6F,0x76,0x65,0x2E,0x67,0x72,0x61,0x70,
|
||||||
0x74,0x20,0x3D,0x20,0x66,0x75,0x6E,0x63,0x74,0x69,0x6F,0x6E,0x20,0x28,0x2E,
|
0x68,0x69,0x63,0x73,0x2E,0x6E,0x65,0x77,0x46,0x6F,0x6E,0x74,0x28,0x66,0x6F,
|
||||||
0x2E,0x2E,0x29,0x0D,0x0A,0x09,0x69,0x66,0x20,0x6E,0x6F,0x74,0x20,0x6C,0x6F,
|
0x6E,0x74,0x2C,0x20,0x73,0x69,0x7A,0x65,0x29,0x0D,0x0A,0x09,0x69,0x66,0x20,
|
||||||
0x76,0x65,0x2E,0x67,0x72,0x61,0x70,0x68,0x69,0x63,0x73,0x2E,0x67,0x65,0x74,
|
0x74,0x79,0x70,0x65,0x28,0x66,0x6F,0x6E,0x74,0x29,0x20,0x3D,0x3D,0x20,0x22,
|
||||||
0x46,0x6F,0x6E,0x74,0x28,0x29,0x20,0x74,0x68,0x65,0x6E,0x20,0x0D,0x0A,0x09,
|
0x6E,0x75,0x6D,0x62,0x65,0x72,0x22,0x20,0x74,0x68,0x65,0x6E,0x0D,0x0A,0x09,
|
||||||
0x09,0x6C,0x6F,0x76,0x65,0x2E,0x67,0x72,0x61,0x70,0x68,0x69,0x63,0x73,0x2E,
|
0x09,0x73,0x69,0x7A,0x65,0x20,0x3D,0x20,0x66,0x6F,0x6E,0x74,0x0D,0x0A,0x09,
|
||||||
0x73,0x65,0x74,0x46,0x6F,0x6E,0x74,0x28,0x6C,0x6F,0x76,0x65,0x2E,0x5F,0x76,
|
0x09,0x66,0x6F,0x6E,0x74,0x20,0x3D,0x20,0x6C,0x6F,0x76,0x65,0x2E,0x5F,0x76,
|
||||||
0x65,0x72,0x61,0x5F,0x74,0x74,0x66,0x2C,0x20,0x31,0x32,0x29,0x0D,0x0A,0x09,
|
0x65,0x72,0x61,0x5F,0x74,0x74,0x66,0x0D,0x0A,0x09,0x65,0x6E,0x64,0x0D,0x0A,
|
||||||
0x65,0x6E,0x64,0x0D,0x0A,0x09,0x6C,0x6F,0x76,0x65,0x2E,0x67,0x72,0x61,0x70,
|
0x09,0x72,0x65,0x74,0x75,0x72,0x6E,0x20,0x6C,0x6F,0x76,0x65,0x2E,0x67,0x72,
|
||||||
0x68,0x69,0x63,0x73,0x2E,0x70,0x72,0x69,0x6E,0x74,0x31,0x28,0x2E,0x2E,0x2E,
|
0x61,0x70,0x68,0x69,0x63,0x73,0x2E,0x6E,0x65,0x77,0x46,0x6F,0x6E,0x74,0x31,
|
||||||
0x29,0x0D,0x0A,0x09,0x6C,0x6F,0x76,0x65,0x2E,0x67,0x72,0x61,0x70,0x68,0x69,
|
0x28,0x66,0x6F,0x6E,0x74,0x2C,0x20,0x73,0x69,0x7A,0x65,0x29,0x0D,0x0A,0x65,
|
||||||
0x63,0x73,0x2E,0x70,0x72,0x69,0x6E,0x74,0x20,0x3D,0x20,0x6C,0x6F,0x76,0x65,
|
0x6E,0x64,0x0D,0x0A,0x0D,0x0A,0x6C,0x6F,0x76,0x65,0x2E,0x67,0x72,0x61,0x70,
|
||||||
|
0x68,0x69,0x63,0x73,0x2E,0x73,0x65,0x74,0x46,0x6F,0x6E,0x74,0x20,0x3D,0x20,
|
||||||
|
0x66,0x75,0x6E,0x63,0x74,0x69,0x6F,0x6E,0x28,0x66,0x6F,0x6E,0x74,0x2C,0x20,
|
||||||
|
0x73,0x69,0x7A,0x65,0x29,0x0D,0x0A,0x09,0x69,0x66,0x20,0x74,0x79,0x70,0x65,
|
||||||
|
0x28,0x66,0x6F,0x6E,0x74,0x29,0x20,0x3D,0x3D,0x20,0x22,0x6E,0x75,0x6D,0x62,
|
||||||
|
0x65,0x72,0x22,0x20,0x74,0x68,0x65,0x6E,0x0D,0x0A,0x09,0x09,0x73,0x69,0x7A,
|
||||||
|
0x65,0x20,0x3D,0x20,0x66,0x6F,0x6E,0x74,0x0D,0x0A,0x09,0x09,0x66,0x6F,0x6E,
|
||||||
|
0x74,0x20,0x3D,0x20,0x6C,0x6F,0x76,0x65,0x2E,0x5F,0x76,0x65,0x72,0x61,0x5F,
|
||||||
|
0x74,0x74,0x66,0x0D,0x0A,0x09,0x65,0x6E,0x64,0x0D,0x0A,0x09,0x72,0x65,0x74,
|
||||||
|
0x75,0x72,0x6E,0x20,0x6C,0x6F,0x76,0x65,0x2E,0x67,0x72,0x61,0x70,0x68,0x69,
|
||||||
|
0x63,0x73,0x2E,0x73,0x65,0x74,0x46,0x6F,0x6E,0x74,0x31,0x28,0x66,0x6F,0x6E,
|
||||||
|
0x74,0x2C,0x20,0x73,0x69,0x7A,0x65,0x29,0x0D,0x0A,0x65,0x6E,0x64,0x0D,0x0A,
|
||||||
|
0x0D,0x0A,0x6C,0x6F,0x76,0x65,0x2E,0x67,0x72,0x61,0x70,0x68,0x69,0x63,0x73,
|
||||||
|
0x2E,0x70,0x72,0x69,0x6E,0x74,0x20,0x3D,0x20,0x66,0x75,0x6E,0x63,0x74,0x69,
|
||||||
|
0x6F,0x6E,0x20,0x28,0x2E,0x2E,0x2E,0x29,0x0D,0x0A,0x09,0x69,0x66,0x20,0x6E,
|
||||||
|
0x6F,0x74,0x20,0x6C,0x6F,0x76,0x65,0x2E,0x67,0x72,0x61,0x70,0x68,0x69,0x63,
|
||||||
|
0x73,0x2E,0x67,0x65,0x74,0x46,0x6F,0x6E,0x74,0x28,0x29,0x20,0x74,0x68,0x65,
|
||||||
|
0x6E,0x20,0x0D,0x0A,0x09,0x09,0x6C,0x6F,0x76,0x65,0x2E,0x67,0x72,0x61,0x70,
|
||||||
|
0x68,0x69,0x63,0x73,0x2E,0x73,0x65,0x74,0x46,0x6F,0x6E,0x74,0x28,0x6C,0x6F,
|
||||||
|
0x76,0x65,0x2E,0x5F,0x76,0x65,0x72,0x61,0x5F,0x74,0x74,0x66,0x2C,0x20,0x31,
|
||||||
|
0x32,0x29,0x0D,0x0A,0x09,0x65,0x6E,0x64,0x0D,0x0A,0x09,0x6C,0x6F,0x76,0x65,
|
||||||
0x2E,0x67,0x72,0x61,0x70,0x68,0x69,0x63,0x73,0x2E,0x70,0x72,0x69,0x6E,0x74,
|
0x2E,0x67,0x72,0x61,0x70,0x68,0x69,0x63,0x73,0x2E,0x70,0x72,0x69,0x6E,0x74,
|
||||||
0x31,0x0D,0x0A,0x65,0x6E,0x64,0x0D,0x0A,0x0D,0x0A,0x6C,0x6F,0x76,0x65,0x2E,
|
0x31,0x28,0x2E,0x2E,0x2E,0x29,0x0D,0x0A,0x09,0x6C,0x6F,0x76,0x65,0x2E,0x67,
|
||||||
|
0x72,0x61,0x70,0x68,0x69,0x63,0x73,0x2E,0x70,0x72,0x69,0x6E,0x74,0x20,0x3D,
|
||||||
|
0x20,0x6C,0x6F,0x76,0x65,0x2E,0x67,0x72,0x61,0x70,0x68,0x69,0x63,0x73,0x2E,
|
||||||
|
0x70,0x72,0x69,0x6E,0x74,0x31,0x0D,0x0A,0x65,0x6E,0x64,0x0D,0x0A,0x0D,0x0A,
|
||||||
|
0x6C,0x6F,0x76,0x65,0x2E,0x67,0x72,0x61,0x70,0x68,0x69,0x63,0x73,0x2E,0x70,
|
||||||
|
0x72,0x69,0x6E,0x74,0x66,0x20,0x3D,0x20,0x66,0x75,0x6E,0x63,0x74,0x69,0x6F,
|
||||||
|
0x6E,0x20,0x28,0x2E,0x2E,0x2E,0x29,0x0D,0x0A,0x09,0x69,0x66,0x20,0x6E,0x6F,
|
||||||
|
0x74,0x20,0x6C,0x6F,0x76,0x65,0x2E,0x67,0x72,0x61,0x70,0x68,0x69,0x63,0x73,
|
||||||
|
0x2E,0x67,0x65,0x74,0x46,0x6F,0x6E,0x74,0x28,0x29,0x20,0x74,0x68,0x65,0x6E,
|
||||||
|
0x20,0x0D,0x0A,0x09,0x09,0x6C,0x6F,0x76,0x65,0x2E,0x67,0x72,0x61,0x70,0x68,
|
||||||
|
0x69,0x63,0x73,0x2E,0x73,0x65,0x74,0x46,0x6F,0x6E,0x74,0x28,0x6C,0x6F,0x76,
|
||||||
|
0x65,0x2E,0x5F,0x76,0x65,0x72,0x61,0x5F,0x74,0x74,0x66,0x2C,0x20,0x31,0x32,
|
||||||
|
0x29,0x0D,0x0A,0x09,0x65,0x6E,0x64,0x0D,0x0A,0x09,0x6C,0x6F,0x76,0x65,0x2E,
|
||||||
0x67,0x72,0x61,0x70,0x68,0x69,0x63,0x73,0x2E,0x70,0x72,0x69,0x6E,0x74,0x66,
|
0x67,0x72,0x61,0x70,0x68,0x69,0x63,0x73,0x2E,0x70,0x72,0x69,0x6E,0x74,0x66,
|
||||||
0x20,0x3D,0x20,0x66,0x75,0x6E,0x63,0x74,0x69,0x6F,0x6E,0x20,0x28,0x2E,0x2E,
|
0x31,0x28,0x2E,0x2E,0x2E,0x29,0x0D,0x0A,0x09,0x6C,0x6F,0x76,0x65,0x2E,0x67,
|
||||||
0x2E,0x29,0x0D,0x0A,0x09,0x69,0x66,0x20,0x6E,0x6F,0x74,0x20,0x6C,0x6F,0x76,
|
0x72,0x61,0x70,0x68,0x69,0x63,0x73,0x2E,0x70,0x72,0x69,0x6E,0x74,0x66,0x20,
|
||||||
0x65,0x2E,0x67,0x72,0x61,0x70,0x68,0x69,0x63,0x73,0x2E,0x67,0x65,0x74,0x46,
|
0x3D,0x20,0x6C,0x6F,0x76,0x65,0x2E,0x67,0x72,0x61,0x70,0x68,0x69,0x63,0x73,
|
||||||
0x6F,0x6E,0x74,0x28,0x29,0x20,0x74,0x68,0x65,0x6E,0x20,0x0D,0x0A,0x09,0x09,
|
0x2E,0x70,0x72,0x69,0x6E,0x74,0x66,0x31,0x0D,0x0A,0x65,0x6E,0x64,0x0D,0x0A,
|
||||||
0x6C,0x6F,0x76,0x65,0x2E,0x67,0x72,0x61,0x70,0x68,0x69,0x63,0x73,0x2E,0x73,
|
0x0D,0x0A,
|
||||||
0x65,0x74,0x46,0x6F,0x6E,0x74,0x28,0x6C,0x6F,0x76,0x65,0x2E,0x5F,0x76,0x65,
|
|
||||||
0x72,0x61,0x5F,0x74,0x74,0x66,0x2C,0x20,0x31,0x32,0x29,0x0D,0x0A,0x09,0x65,
|
|
||||||
0x6E,0x64,0x0D,0x0A,0x09,0x6C,0x6F,0x76,0x65,0x2E,0x67,0x72,0x61,0x70,0x68,
|
|
||||||
0x69,0x63,0x73,0x2E,0x70,0x72,0x69,0x6E,0x74,0x66,0x31,0x28,0x2E,0x2E,0x2E,
|
|
||||||
0x29,0x0D,0x0A,0x09,0x6C,0x6F,0x76,0x65,0x2E,0x67,0x72,0x61,0x70,0x68,0x69,
|
|
||||||
0x63,0x73,0x2E,0x70,0x72,0x69,0x6E,0x74,0x66,0x20,0x3D,0x20,0x6C,0x6F,0x76,
|
|
||||||
0x65,0x2E,0x67,0x72,0x61,0x70,0x68,0x69,0x63,0x73,0x2E,0x70,0x72,0x69,0x6E,
|
|
||||||
0x74,0x66,0x31,0x0D,0x0A,0x65,0x6E,0x64,0x0D,0x0A,0x0D,0x0A,
|
|
||||||
};
|
};
|
||||||
// [/graphics.lua]
|
// [/graphics.lua]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user