1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2024-12-24 13:45:47 +00:00

add Lua function: setBGGradient()

This commit is contained in:
fgenesis 2015-01-28 02:21:48 +01:00
parent 2612b6e251
commit 220c8f1c08

View file

@ -38,6 +38,7 @@ extern "C"
#include "AfterEffect.h"
#include "PathFinding.h"
#include <algorithm>
#include "Gradient.h"
#include "../BBGE/MathFunctions.h"
@ -8976,6 +8977,19 @@ luaFunc(learnRecipe)
luaReturnNil();
}
luaFunc(setBGGradient)
{
if(!dsq->game->grad)
dsq->game->createGradient();
Vector c1(lua_tonumber(L, 1), lua_tonumber(L, 2), lua_tonumber(L, 3));
Vector c2(lua_tonumber(L, 4), lua_tonumber(L, 5), lua_tonumber(L, 6));
if(getBool(L, 7))
dsq->game->grad->makeHorizontal(c1, c2);
else
dsq->game->grad->makeVertical(c1, c2);
luaReturnNil();
}
luaFunc(createDebugText)
{
DebugFont *txt = new DebugFont(lua_tointeger(L, 2), getString(L, 1));
@ -10082,6 +10096,7 @@ static const struct {
luaRegister(getScreenVirtualSize),
luaRegister(isMiniMapCursorOkay),
luaRegister(isShuttingDownGameState),
luaRegister(setBGGradient),
luaRegister(inv_isFull),
luaRegister(inv_getMaxAmount),