This thread is a few years old. Some details may refer to an earlier version of Visionaire Studio. Current tutorials
-- left part
-- acquire left cursor position
local posleft = getCursorPos()
-- hide left cursor if left screen border reached
if posleft.x < 5
then
local cond = getObject("Conditions[Show_Left_Arrow?]")
cond:setValue(VConditionValue, false)
end
-- show left arrow if cursor scrolls to the right
if posleft.x > 1920
then
local cond = getObject("Conditions[Show_Left_Arrow?]")
cond:setValue(VConditionValue, true)
end
-- right part
-- acquire right cursor position
local posright = getCursorPos()
-- hide right cursor if right screen border reached
if posright.x > 3995
then
local cond = getObject("Conditions[Show_Right_Arrow?]")
cond:setValue(VConditionValue, false)
end
-- show right arrow if cursor scrolls to the left
if posright.x < 2080
then
local cond = getObject("Conditions[Show_Right_Arrow?]")
cond:setValue(VConditionValue, true)
end
The free version covers up to 25 scenes per project. For more scenes and to sell your game, you need a license. Forum readers get the Indie Bundle 15 % off with the code FORUM15: €84.15 instead of €99, valid until 31 Dec 2026.Black Friday: the Indie Bundle is 30 % off until 1 Dec 2026, €69.30 instead of €99. The code BLACKFRIDAY is already applied.
Get 15 % off Try it for freeif ( game.ScrollPosition.x + getCursorPos().x ) < 5 then
if game.ScrollPosition.x == 0 then
-- hide left arrow
elseif game.ScrollPosition.x >= (scene_width - game.ScrollPosition.x) then
-- hide right arrow
else
-- show left arrow; show right arrow
end
scnSize = nil -- empty variable that we will be storing the scene size into...
-- * call this function once at the beginning of each interactive scene * --
function getSceneSize()
scnSize = game.CurrentScene.SceneSprite.SpriteSprite:getSize()
end
function navArrows()
if not game.CurrentScene:getBool(VSceneIsMenu) and scnSize ~= nil then
if game.ScrollPosition.x == 0 then Conditions["Show_Left_Arrow"].ConditionValue = false else Conditions["Show_Left_Arrow"].ConditionValue = true end
if game.ScrollPosition.x >= (scnSize.x - game.WindowResolution.x) then Conditions["Show_Right_Arrow"].ConditionValue = false else Conditions["Show_Right_Arrow"].ConditionValue = true end
end
end
registerEventHandler("mainLoop", "navArrows") -- create the loop
scnSize = nil -- empty variable that we will be storing the scene size into...
local scn = nil
-- * call this function once at the beginning of each interactive scene * --
function getSceneSize()
scnSize = game.CurrentScene.SceneSprite:getSize()
end
function navArrows()
if not game.CurrentScene:getBool(VSceneIsMenu) and scnSize ~= nil then
if game.ScrollPosition.x == 0 then Conditions["Show_Left_Arrow"].ConditionValue = false else Conditions["Show_Left_Arrow"].ConditionValue = true end
if game.ScrollPosition.x >= (scnSize.x - game.WindowResolution.x) then Conditions["Show_Right_Arrow"].ConditionValue = false else Conditions["Show_Right_Arrow"].ConditionValue = true end
end
-- + --
if scn ~= game.CurrentScene:getName() and not game.CurrentScene:isEmpty() then
scn = game.CurrentScene:getName(); startAction("Actions[get_scene_size]")
end
end
registerEventHandler("mainLoop", "navArrows") -- create the loop
This thread is closed because nobody has replied for more than a year. Feel free to ask your question in a new thread.
New threadDeponia, The Whispered World and more than 160 other games were made with Visionaire Studio. The free version covers up to 25 scenes. For more scenes there is Visionaire Studio PRO from €75, and to sell your game the Indie Bundle for €99.
Until December 1: the Indie Bundle is 30% off with the code BLACKFRIDAY, €69.30 instead of €99.