function scene_overview ()
local gx = game.WindowResolution.x
local gy = game.WindowResolution.y
print("x: " .. gx .. " y: " .. gy )
game.GameScrollToPoint({x=gx, y=gy})
end
3:05:14 PM: x: 1280 y: 720
3:05:14 PM: [string "functions"]:9: attempt to call field 'GameScrollToPoint' (a table value)
3:05:14 PM: stack traceback:
[string "Map1: At beginning of scene: Execute script '..."]:5: in function 'GameScrollToPoint'
[string "functions"]:9: in function 'scene_overview'
[string "Map1: At beginning of scene: Execute script '..."]:2: in function
[C]: in function 'xpcall'
[string "Map1: At beginning of scene: Execute script '..."]:1: in main chunk
game:setValue(VGameScrollToPoint, {x=gx, y=gy})
game.ScrollToPoint = {x = gx, y = gy}
function scene_overview ()
local gx = game.WindowResolution.x
local gy = game.WindowResolution.y
local waypoint = 0
while waypoint < 4 do
scroller = game:getBool(VGameScrollTo)
if not scroller then
if waypoint == 0 then
waypoint = 1
game:setValue(VGameScrollToPoint, {x=0, y=gy})
elseif waypoint == 1 then
waypoint = 2
game:setValue(VGameScrollToPoint, {x=gx, y=gy})
elseif waypoint == 2 then
waypoint = 3
game:setValue(VGameScrollToPoint, {x=gx, y=0})
elseif waypoint == 3 then
waypoint = 4
game:setValue(VGameScrollToPoint, {x=0, y=0})
end
end
end
end
local function scrollTo()
if not game.ScrollTo then
if game.ScrollPosition == { x = 0, y = 0 } then game.ScrollToPoint = { x = 300, y = 0 }
elseif game.ScrollPosition == { x = 300, y = 0 } then game.ScrollToPoint = { x = 0, y = 0 }; unregisterEventHandler("mainLoop", "scrollTo")
end
end
end
registerEventHandler("mainLoop", "scrollTo")