mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2025-10-07 23:02:07 +00:00
Add Lua function text_getStringWidth()
This commit is contained in:
parent
dee156cf7a
commit
b70de7f94b
6 changed files with 53 additions and 1 deletions
|
@ -8651,7 +8651,7 @@ luaFunc(avatar_updatePosition)
|
|||
|
||||
luaFunc(avatar_toggleMovement)
|
||||
{
|
||||
dsq->game->avatar->toggleMovement((bool)lua_tointeger(L, 1));
|
||||
dsq->game->avatar->toggleMovement(getBool(L));
|
||||
luaReturnNil();
|
||||
}
|
||||
|
||||
|
@ -9047,6 +9047,12 @@ luaFunc(text_getHeight)
|
|||
luaReturnNum(txt ? txt->getHeight() : 0.0f);
|
||||
}
|
||||
|
||||
luaFunc(text_getStringWidth)
|
||||
{
|
||||
BaseText *txt = getText(L);
|
||||
luaReturnNum(txt ? txt->getStringWidth(getString(L, 2)) : 0.0f);
|
||||
}
|
||||
|
||||
luaFunc(loadShader)
|
||||
{
|
||||
int handle = 0;
|
||||
|
@ -10120,6 +10126,7 @@ static const struct {
|
|||
luaRegister(text_setWidth),
|
||||
luaRegister(text_setAlign),
|
||||
luaRegister(text_getHeight),
|
||||
luaRegister(text_getStringWidth),
|
||||
|
||||
luaRegister(loadShader),
|
||||
luaRegister(createShader),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue