Hi guys, I need your help.
I recently started to learn GameSalad and, after trying some basic functions, I'm trying to do the first my simple game.
I'd like to realize an universal game that will work on any device.
1. At the beginning I chose ipad portrait and in the attributes of the game I put portrait and checked "Resolution indipendence";
2. In illustrator I created images of double size (I created my job over a white background 768W * 1024H and before esporting the images in PNG I doubled the dimension) ... is it right?;
3. I downloaded the zip file and I opened the portrait project, but I did not understand some things:
I understand that I have to set for each element that is on the left side one expression and for each element that is on the right side another expression .If I go to preview (in the example zip uploaded in this forum) and I put (for example) Iphone5 portrait/overscan ... I see that the most external 4 squares are cut while the 4 interior are right... why?
Is there any Italian who can answer me? My English is not good.
On the contrary If you answer me in English, can you write me in simple way?
Thank you all
Chiara
@airone747 said:
Is there any Italian who can answer me? My English is not good.
On the contrary If you answer me in English, can you write me in simple way?
Thank you all
Chiara
You have to reset the game after changing the device used.
So...do I need to apply this to every actor in the game, top and bottom of the screen? or Just the UI etc that are on the screen all the time? Lots of actors, lots of work!
@Balvamar said:
So...do I need to apply this to every actor in the game, top and bottom of the screen? or Just the UI etc that are on the screen all the time? Lots of actors, lots of work!
You would apply it to every actor on the edges of the screen so they don't get cut off when using overscan.
If you download the project file, it shows you with both portrait and landscape.
Unfortunately, this is just not working for me. I have set the set.position.Y expression, along with Game.Display Size.Height and Game.Display Size.Width within the expression itself. I have checked the position and graphic size parameters as well. Everything is exactly as your download, yet the graphic image, a back button just does not reposition itself when I set the other device (iphone 6) and I hit the reset button. What gives!!!! Please help as if I can get it to work, your solution is very elegant.
@pixzoid_boy said:
Unfortunately, this is just not working for me. I have set the set.position.Y expression, along with Game.Display Size.Height and Game.Display Size.Width within the expression itself. I have checked the position and graphic size parameters as well. Everything is exactly as your download, yet the graphic image, a back button just does not reposition itself when I set the other device (iphone 6) and I hit the reset button. What gives!!!! Please help as if I can get it to work, your solution is very elegant.
Is the example project i posted working as it should? If so, then i would double check the code in your project, or make sure that the actor's starting position is where you want it to be.
Also, i can look at the project for you if you'd like.
Excellent I really want to learn to use this effectively...for so long Ive wanted to find a trusted sure fire way to stop having to stretch my games thanks !
@pixzoid_boy said:
What gives!!!! Please help as if I can get it to work, your solution is very elegant.
This code works. If it's not working then you must have copied it wrong or your project isn't set up as iPad. Which in this case means you have to change the formula a little.
If your project is iPad, the easiest way is simply open both this sample project and your project together and drag the behaviour into your actor from one project to another. Make sure you are using the correct behaviour for portrait/landscape & left/right/top/bottom as this matters too.
I've used this method for many projects and the only issue I have found is with android incorrectly detecting screen sizes but that's a GS bug and won't be solved soon as it's been alive for many moons and most likely not even on their radar to fix. But the logic itself is spot on thanks to @Lovejoy
@gingagaming said:
the only issue I have found is with android incorrectly detecting screen sizes but that's a GS bug and won't be solved soon as it's been alive for many moons and most likely not even on their radar to fix. But the logic itself is spot on thanks to @Lovejoy
You can get this to work on Android too.
The screen size detection on android takes a little more time, so instead of a "change attribute", you just need to use a "constrain attribute" to detect the screen size.
When I try to copy the rule it gives me this error "Invalid Display String For Attribute". If i replace "game.Screen.Size.Height" with "game.Display Size.Height" it doesn't work anymore.
When I try to copy the rule it gives me this error "Invalid Display String For Attribute". If i replace "game.Screen.Size.Height" with "game.Display Size.Height" it doesn't work anymore.
Is there a fix for this?
I just used this method a few days ago and it worked fine. Make sure that your expression is identical to the one in the demo file. Open the expressions side by side and compare them.
If you drgagged the behavior from the demo project to your own project, it might have removed the self.position Y from it, so you need to add that back in.
Yes the expressions are identical but it is still not working. I've tried typing the rule manually, copying from expression editor to expression editor and dragging from the demo file.
I think the problem lies in the fact that i can't select screen.size in the expression editor. What version of GS are u using? I'm using 1.24.42
You can use a combination of max() and min() functions so you don't have to edit the formula depending on which side of the screen your actor is on. For example the statement "max(min(game.Screen.Size.Width/2-Self.Position.X,1),-1)" will return 1 if the actor is on the left side and -1 if on the right side of the screen.
Just add it between "Self.Position.X+" and "abs((((game.Screen....." with a "*" as shown in the formula below.
@colander Wow...this just gets better and better! Thanks so much for sharing.
By the way, how would this code need to be adjusted for a landscape build?
Comments
Oh yeahhhhhhh
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
Hi guys, I need your help.
I recently started to learn GameSalad and, after trying some basic functions, I'm trying to do the first my simple game.
I'd like to realize an universal game that will work on any device.
1. At the beginning I chose ipad portrait and in the attributes of the game I put portrait and checked "Resolution indipendence";
2. In illustrator I created images of double size (I created my job over a white background 768W * 1024H and before esporting the images in PNG I doubled the dimension) ... is it right?;
3. I downloaded the zip file and I opened the portrait project, but I did not understand some things:
I understand that I have to set for each element that is on the left side one expression and for each element that is on the right side another expression .If I go to preview (in the example zip uploaded in this forum) and I put (for example) Iphone5 portrait/overscan ... I see that the most external 4 squares are cut while the 4 interior are right... why?
Is there any Italian who can answer me? My English is not good.
On the contrary If you answer me in English, can you write me in simple way?
Thank you all
Chiara
You have to reset the game after changing the device used.
Fortuna Infortuna Forti Una
yessssssss it works ! thanksssssssssss
So...do I need to apply this to every actor in the game, top and bottom of the screen? or Just the UI etc that are on the screen all the time? Lots of actors, lots of work!
You would apply it to every actor on the edges of the screen so they don't get cut off when using overscan.
If you download the project file, it shows you with both portrait and landscape.
Fortuna Infortuna Forti Una
ok, i'll experiment with that. thanks
Np, i named the expressions left, right, etc to minimize confusion.
Fortuna Infortuna Forti Una
So this will solve the problem with the overscan?! No more test & error?
You should always test But yes it works really well with overscan, check out the project file attached to the main post.
Fortuna Infortuna Forti Una
Very, very Nice!
How succinct. Well done Sir! Multo bene.
Grazie
Fortuna Infortuna Forti Una
Unfortunately, this is just not working for me. I have set the set.position.Y expression, along with Game.Display Size.Height and Game.Display Size.Width within the expression itself. I have checked the position and graphic size parameters as well. Everything is exactly as your download, yet the graphic image, a back button just does not reposition itself when I set the other device (iphone 6) and I hit the reset button. What gives!!!! Please help as if I can get it to work, your solution is very elegant.
Is the example project i posted working as it should? If so, then i would double check the code in your project, or make sure that the actor's starting position is where you want it to be.
Also, i can look at the project for you if you'd like.
Fortuna Infortuna Forti Una
Excellent I really want to learn to use this effectively...for so long Ive wanted to find a trusted sure fire way to stop having to stretch my games thanks !
1 awesome for you sir
Complete Guide to iOS Publishing {} Complete Guide to Mac Publishing
Lovely! Thanks!
Interaction designer, blogger, game developer, sometimes tech enthusiast and sometimes tech pessimist. World champion of tsundoku. @damianogui
This code works. If it's not working then you must have copied it wrong or your project isn't set up as iPad. Which in this case means you have to change the formula a little.
If your project is iPad, the easiest way is simply open both this sample project and your project together and drag the behaviour into your actor from one project to another. Make sure you are using the correct behaviour for portrait/landscape & left/right/top/bottom as this matters too.
I've used this method for many projects and the only issue I have found is with android incorrectly detecting screen sizes but that's a GS bug and won't be solved soon as it's been alive for many moons and most likely not even on their radar to fix. But the logic itself is spot on thanks to @Lovejoy
You can get this to work on Android too.
The screen size detection on android takes a little more time, so instead of a "change attribute", you just need to use a "constrain attribute" to detect the screen size.
Mental Donkey Games
Website - Facebook - Twitter
Hi guys
When I try to copy the rule it gives me this error "Invalid Display String For Attribute". If i replace "game.Screen.Size.Height" with "game.Display Size.Height" it doesn't work anymore.
Is there a fix for this?
I just used this method a few days ago and it worked fine. Make sure that your expression is identical to the one in the demo file. Open the expressions side by side and compare them.
If you drgagged the behavior from the demo project to your own project, it might have removed the self.position Y from it, so you need to add that back in.
Mental Donkey Games
Website - Facebook - Twitter
Yes the expressions are identical but it is still not working. I've tried typing the rule manually, copying from expression editor to expression editor and dragging from the demo file.
I think the problem lies in the fact that i can't select screen.size in the expression editor. What version of GS are u using? I'm using 1.24.42
I'm using the same GS version. You can select the attribute in the expression editor. It's in the device attributes.
Mental Donkey Games
Website - Facebook - Twitter
I was searching in the "game" attributes but I've fount it in the "device" attributes like you mentioned.
The only way I can get this to work is when I drag the actor from the inspector to the inspector in my project but at least it works now!
Thank you MentalDonkeyGames
Thanks so much for sharing this...a game changer for me...so simple
You can use a combination of max() and min() functions so you don't have to edit the formula depending on which side of the screen your actor is on. For example the statement "max(min(game.Screen.Size.Width/2-Self.Position.X,1),-1)" will return 1 if the actor is on the left side and -1 if on the right side of the screen.
Just add it between "Self.Position.X+" and "abs((((game.Screen....." with a "*" as shown in the formula below.
"Self.Position.X+max(min(game.Screen.Size.Width/2-Self.Position.X,1),-1)*abs((((game.Screen.Size.Height *1024)/game.Screen.Size.Width)-768)/2)"
Universal Binary Template - Universal Binary Template Instructions Rev 4 (Short) - Custom Score Display Template
@colander Wow...this just gets better and better! Thanks so much for sharing.
By the way, how would this code need to be adjusted for a landscape build?
@strag just change game.Screen.Size.Width to game.Screen.Size.Height and self.Position.X to self.Position.Y
"max(min(game.Screen.Size.Height/2-Self.Position.Y,1),-1)"
Universal Binary Template - Universal Binary Template Instructions Rev 4 (Short) - Custom Score Display Template
@colander That's great thanks.