This thread is a few years old. Some details may refer to an earlier version of Visionaire Studio. Current tutorials
openInterface("Inventory", 600, easeCircOut)closeInterface("Inventory", 800, easeBounceOut)--[[
Sliding Interface MKII [v3] (27/11/2014)
Written by AFRLme [Lee Clarke]
-- + --
alternatingfrequencies@hotmail.com | skype @ AFRLme
-- + --
This script is donation optional. In game credit is non-negotiable.
You are free to: ¹ use it in your game(s). ² modify the script.
Do not remove - or edit - this comment block.
--]]
-- * local variables * --
local p, ox, oy -- empty variables
-- * local tables * --
local t = {} -- empty table
t["Blood_Interface"] = {x_in = 115, x_out = 0, y_in = 0, y_out = 0, xo = 0, yo = 0, dir = 2, state = false} -- from right
t["Inventory"] = {x_in = -635, x_out = 0, y_in = 0, y_out = 0, xo = 0, yo = 0, dir = 2, state = false} -- from right
-- * function that slides the interface out * --
function openInterface(int, delay, easing, dir)
if t[int]["state"] ~= true then t[int]["state"] = true -- if not already sliding out then begin sliding out (safety measure to make sure it keeps sliding)
if t[int].dir == 1 or t[int].dir == 2 then p = math.floor(( Interfaces[int].InterfaceOffset.x - t[int].x_out) / (t[int].x_in - t[int].x_out) * 100); delay = math.floor((delay / 100) * p ) end
if t[int].dir == 3 or t[int].dir == 4 then p = math.floor(( Interfaces[int].InterfaceOffset.y - t[int].y_out) / (t[int].y_in - t[int].y_out) * 100); delay = math.floor((delay / 100) * p ) end
startObjectTween( Interfaces[int], VInterfaceOffset, Interfaces[int].InterfaceOffset, {x = t[int].x_out, y = t[int].y_out}, delay, easing)
end
end
-- * function that slides the interface in * --
function closeInterface(int, delay, easing, dir)
t[int]["state"] = false
if Conditions["mouse_wheel_mode"].ConditionValue then ox = t[int].xo; oy = t[int].yo else ox = 0; oy = 0 end
if t[int].dir == 1 or t[int].dir == 2 then p = math.floor(( Interfaces[int].InterfaceOffset.x - t[int].x_in) / (t[int].x_out - t[int].x_in) * 100); delay = math.floor((delay / 100) * p ) end
if t[int].dir == 3 or t[int].dir == 4 then p = math.floor(( Interfaces[int].InterfaceOffset.y - t[int].y_in) / (t[int].y_out - t[int].y_in) * 100); delay = math.floor((delay / 100) * p ) end
startObjectTween( Interfaces[int], VInterfaceOffset, Interfaces[int].InterfaceOffset, {x = t[int].x_in + ox, y = t[int].y_in + oy}, delay, easing)
endCreate point and click adventures without coding. The free version covers up to 25 scenes per project. For more scenes or to earn money with your game, you need a license.
See the Indie Bundle Try it for freelocal int = Interfaces["example"]
if int.InterfaceOffset.x == 0 then -- slide in
int:to(1000, { InterfaceOffset = {x = -100, y = int.InterfaceOffset.y} }, easeCircOut)
elseif int.InterfaceOffset.x == -100 then -- slide out
int:to(1000, { InterfaceOffset = {x = 0, y = int.InterfaceOffset.y} }, easeBounceOut)
endWow. It works ! Thank you so much ! :-DIt's an execute a script type. You can add it to a key action or the mouse wheel actions or an interface button, & you're welcome.