local ss = game.CurrentScene.SceneSprite.SpriteSprite:getSize()
print(ss.x, ss.y) -- print scene width & height to log
function getSceneSize()
ss = game.CurrentScene.SceneSprite.SpriteSprite:getSize()
end
getSceneSize()
--[[
in this example we are checking if scroll position is greater than the
background size minus the default game resolution. Otherwise the
background would be pushed out of the viewport. I know this isn't
technically possible with the scroll position value, as it automatically
corrects itself, but the viewport function of the shader toolkit however
does require safeguards to prevent it from scrolling past the background
on both x & y.
--]]
if game.ScrollPosition.x > (ss.x - game.WindowResolution.x) then
game.ScrollPosition.x = (ss.x - game.WindowResolution.x)
end
function getSceneSize()
ss = game.CurrentScene.Sprite:getSize()
end