I am implementing the Multiple Screensizes tutorial (link below) and have extra padding outside the window to the left and right. I also scroll to the middle on X axis on start to work for most screen ratios, but the issue I have is that I need objects to stay inside the window and not bound to the layout.
Right now, the player (bound to layout) is running off the screen because my layout is 900 wide, but only 720 wide window. How do I make it so that he's bound to the window edges? Do I need to detect each X of the window with WindowWidth? If so, how do I make it dynamic depending on what device they are on?
Multiple screen size tutorial:
Probably the easiest way would be to clamp the players x-coordinate
system every tick:
player set x - clamp(player.x,viewportleft(0),viewportright(0))
0 is the layer from which the x coordinates are taken.
Develop games in your browser. Powerful, performant & highly capable.
LittleStain That works really well! Thank you.