From 220c8f1c0884f8b3ebfbe0ed027ce9d383f631f7 Mon Sep 17 00:00:00 2001 From: fgenesis Date: Wed, 28 Jan 2015 02:21:48 +0100 Subject: [PATCH] add Lua function: setBGGradient() --- Aquaria/ScriptInterface.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Aquaria/ScriptInterface.cpp b/Aquaria/ScriptInterface.cpp index 965379a..232e143 100644 --- a/Aquaria/ScriptInterface.cpp +++ b/Aquaria/ScriptInterface.cpp @@ -38,6 +38,7 @@ extern "C" #include "AfterEffect.h" #include "PathFinding.h" #include +#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),