Spawning objects using the screensize attribute
I am spawning object using random(35,screenSize - 35) for where they spawn on the X, but they are spawning outside of the screen. I am trying to build the app for all devices so I figured screenSize would work, should I use sceneSize instead?
Comments
Hi @pixelstix There aren't any default attributes in GSC called screenSize or sceneSize... not sure where you're getting those from....
You have game.Display Size.Width (and game.Display Size.Height); as well as scene.Size.Width (and scene.Size.Height). Use either one and it should work out.
PS Welcome to the GSC Forums. :-)
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
However, for whatever reason, you say it's spawning outside the screen area, so try Game > Display Size > Width to see if that works for you.
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps