This thread is a few years old. Some details may refer to an earlier version of Visionaire Studio. Current tutorials
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
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
-- * hide the left arrow (before reaching 0, or the arrow will not hide) * --
if game.ScrollPosition.x < 5
then
Conditions["Show_Left_Arrow"].ConditionValue = false
end
-- * show the previously hidden left arrow (when reaching the right border of the screen (not picture)) * --
-- * it has to be a limited area or it will also activate the right arrow scripts below * --
if game.ScrollPosition.x > game.WindowResolution.x and < (game.WindowResolution.x +5)
then
Conditions["Show_Left_Arrow"].ConditionValue = true
end
-- * hide the right arrow (before reaching the right border of the panorama image, or the arrow will not hide) * --
if game.ScrollPosition.x > (scnSize.x - 5)
then
Conditions["Show_Right_Arrow"].ConditionValue = false
end
-- * show the previously hidden right arrow (when reaching the left border of the screen (not picture)) * --
-- * it has to be a limited area or it will also activate the left arrow scripts above * --
if game.ScrollPosition.x ((scnSize.x - game.WindowResolution.x) - 5)
then
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
I don't currently have any scenes greater than the default game resolution for testing
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.
Through December 1: all licenses 30% off, for example the Indie Bundle for €69.30 instead of €99. Applied automatically at checkout.