Spread actors evenly across the screen on any screensize?
Daniel543M
Member, PRO Posts: 47
Hey guys,
In my game there is a scene where there are 9 actors that go from one end (left) to the other (right).
The project is set up for iPad Landscape and these actors are on Y:384.
I'm trying to figure out a way to have it so that no matter what device the game is played on, these 9 actors will distribute along the X axis evenly across the whole screen width.
The first actor from the left is located at X:60 Y:384
I've added a 'change attribute' rule to each actor that changes their X position to the result of a formula. But I don't quite know what the formula should be so that it works on every device.
The formula I have now works when it's iPad but not other sizes.
Hopefully I've made some sense
Thank you!
Daniel
Comments
I'm pretty sure I saw @Braydon_SFX from gshelper post something like that a while ago. Hopefully he'll see this and respond.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
Thanks for the mention, Jamie.
Yes. Here is a video tutorial:
https://www.google.com/url?sa=t&source=web&rct=j&ei=-ZHkVI2BGcGiNr6mhNgI&url=http://m.youtube.com/watch?v=hMPxt32mcuE&ved=0CBwQtwIwAA&usg=AFQjCNGH0jMpufTxU8KRdeKFD9T3oFr-nQ&sig2=dtKHdckaT8yeymw3-RSPlg
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
Thanks for the replies the both of you.
Since posting this, I've come up with my own formula (which I think is much simpler than the one in the video and it suits my purpose better). The only issue I was having was that the formula wasn't actually doing anything.
Upon watching your video tutorial I figured out that it was because I wasn't spawning in the actor. I just had a change attribute on each one already on the scene and it wasn't working.
Now everything is working as far as I can see.
Thanks again
Daniel
Glad you got it working.
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx