My Universal Binary Overscan Secret Weapon

2

Comments

  • CaptFinnCaptFinn Member Posts: 1,828

    Oh yeahhhhhhh

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273

    @FINNBOGG said:
    Oh yeahhhhhhh

  • airone747airone747 Member, PRO Posts: 13

    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

  • LovejoyLovejoy Member Posts: 2,078

    @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.

    Fortuna Infortuna Forti Una

  • airone747airone747 Member, PRO Posts: 13

    yessssssss it works ! thanksssssssssss :#

  • BalvamarBalvamar Member, PRO Posts: 117

    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!

  • LovejoyLovejoy Member Posts: 2,078

    @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.

    Fortuna Infortuna Forti Una

  • BalvamarBalvamar Member, PRO Posts: 117

    ok, i'll experiment with that. thanks :)

  • LovejoyLovejoy Member Posts: 2,078

    @Balvamar said:
    ok, i'll experiment with that. thanks :)

    Np, i named the expressions left, right, etc to minimize confusion.

    Fortuna Infortuna Forti Una

  • http_gamesaladhttp_gamesalad Member Posts: 1,340

    So this will solve the problem with the overscan?! :) No more test & error?

  • LovejoyLovejoy Member Posts: 2,078

    @http_gamesalad said:
    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

  • Case86Case86 Member, PRO Posts: 35

    :) Very, very Nice!

  • PhilipCCPhilipCC Encounter Bay, South AustraliaMember Posts: 1,390

    @Lovejoy said:
    You have to reset the game after changing the device used.

    How succinct. Well done Sir! :) Multo bene.

  • LovejoyLovejoy Member Posts: 2,078

    @PhilipCC said:

    Grazie

    Fortuna Infortuna Forti Una

  • pixiopixio Member, PRO Posts: 8

    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.

  • LovejoyLovejoy Member Posts: 2,078

    @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.

    Fortuna Infortuna Forti Una

  • Thunder_ChildThunder_Child Member Posts: 2,343

    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

  • demyguydemyguy Member, PRO Posts: 13

    Lovely! Thanks!

    Interaction designer, blogger, game developer, sometimes tech enthusiast and sometimes tech pessimist. World champion of tsundoku. @damianogui

  • gingagaminggingagaming FREELANCE GS DEV Member Posts: 1,685
    edited December 2015

    @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

  • MentalDonkeyGamesMentalDonkeyGames Member Posts: 1,276

    @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.

    Mental Donkey Games
    Website - Facebook - Twitter

  • UncloudedStudioUncloudedStudio NetherlandsMember Posts: 285

    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?

  • MentalDonkeyGamesMentalDonkeyGames Member Posts: 1,276

    @UncloudedStudio said:
    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

  • UncloudedStudioUncloudedStudio NetherlandsMember Posts: 285

    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

  • MentalDonkeyGamesMentalDonkeyGames Member Posts: 1,276

    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

  • UncloudedStudioUncloudedStudio NetherlandsMember Posts: 285

    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 :)

  • RedRoboRedRobo Member, PRO Posts: 682

    Thanks so much for sharing this...a game changer for me...so simple ;)

  • colandercolander Member Posts: 1,610
    edited February 2016

    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)"

  • RedRoboRedRobo Member, PRO Posts: 682

    @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?

  • colandercolander Member Posts: 1,610
    edited February 2016

    @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)"

  • RedRoboRedRobo Member, PRO Posts: 682

    @colander That's great thanks.

Sign In or Register to comment.