Universal Build Question

hockeycrazy033hockeycrazy033 Member Posts: 14
edited April 2015 in Working with GS (Mac)

Does anyone have a good Universal Build Tutorial. I've checked everywhere on youtube, and the forums here, and it seems like most information is old, or hard to follow.

Right now my actors get stretched out on smaller devices, I just need to make them the correct size.

I am making a scrolling background game, Portrait IPad is my start if that is needed.

Thanks

Comments

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

    Honestly, and I say this on almost every thread like this, using overscan exclusively is easy and produces great results. Just place your HUD actors in a way that they won't be chopped off on smaller devices. Make sense?

  • hockeycrazy033hockeycrazy033 Member Posts: 14

    @Braydon_SFX said:
    Honestly, and I say this on almost every thread like this, using overscan exclusively is easy and produces great results. Just place your HUD actors in a way that they won't be chopped off on smaller devices. Make sense?

    I think so, and thanks for the response. I'll give it a look next time i'm at school. Its annoying b/c for some reason the PC version doesn't have the different device views, so I need to get a mac at school to use.

  • stueynetstueynet TorontoMember Posts: 166

    There is no silver bullet. But the basic idea is you can create an actor that controls a few screen variables. For example I have an actor that sets a game attribute called deviceAdjust. This is a real number that decides how much additional padding an element might need.

    So for each screen size you set this variable. You can do this with game.Screen.Size.Width.

    An old iPhone would landscape be 480. so in that case any elements close to the edges need to be pushed over by about 50 extra pixels because my default game size is iPhone 5. iPad is 1024 and requires 70 pixels.

    So in my actor I ask

    Is game.Screen.Size.Width = 480? If so then set the game attribute deviceAdjust to be 40. Do that for any device size you would like to target.

    Next you need to move the objects when they are spawned by the amount of the deviceAdjustment. This is super easy if you just have to deal with HUD elements. In my latest game I spawn everything on the screen so I just add the +- deviceAdjust to the spawn coordinates.

    I have attached a sample project for your pleasure. Try previewing, then switch the device, change to overscan, and hit the little refresh circle.

    My Latest GS Game - Tiny Spirit
    My First GS Game - Dashing Ralph

  • hockeycrazy033hockeycrazy033 Member Posts: 14

    @stueynet said:
    There is no silver bullet. But the basic idea is you can create an actor that controls a few screen variables. For example I have an actor that sets a game attribute called deviceAdjust. This is a real number that decides how much additional padding an element might need.

    So for each screen size you set this variable. You can do this with game.Screen.Size.Width.

    An old iPhone would landscape be 480. so in that case any elements close to the edges need to be pushed over by about 50 extra pixels because my default game size is iPhone 5. iPad is 1024 and requires 70 pixels.

    So in my actor I ask

    Is game.Screen.Size.Width = 480? If so then set the game attribute deviceAdjust to be 40. Do that for any device size you would like to target.

    Next you need to move the objects when they are spawned by the amount of the deviceAdjustment. This is super easy if you just have to deal with HUD elements. In my latest game I spawn everything on the screen so I just add the +- deviceAdjust to the spawn coordinates.

    I have attached a sample project for your pleasure. Try previewing, then switch the device, change to overscan, and hit the little refresh circle.

    So this makes sense to me. I can use this technique to slide over static game pieces that are part of my HUD i guess.

    But in my game I have a moving actor. and it moves to 5 specific locations.

    it starts at deviceWidth/2 right in the middle. and i move him left and right. there are 5 columns, so each column is Width/5. So for smaller devices do I need to resize my actor? this is so confusing, when i do it on overscan and switch to a smaller device, it doesnt move right cuz its set up for ipad, and it goes off screen to the right, and the columns don't line up any more.

    Any suggestions?

  • hockeycrazy033hockeycrazy033 Member Posts: 14

    @BBEnk said:
    hockeycrazy033 If your game is a single scene check out my video on thread link below page 3 1st video.

    http://forums.gamesalad.com/discussion/72589/universal-builds-for-ios-and-android-and-anything-else-using-ipad-build-and-stretch-no-distortion#latest

    I used your tut for portrait mode on the same page.

    It works on the gamesalad preview on all devices now. I'm happy with the way it looks on that.

    Now i finally downloaded the viewer to my iphone, and when i click play, the scene doesnt load anything, its just black, and then it shuts down. Any idea??

  • hockeycrazy033hockeycrazy033 Member Posts: 14

    I built 90 percent of it on my windows machine. And it started as Ipad Portrait. But when i take it to mac it says ipad landscape idk why.

  • BBEnkBBEnk Member Posts: 1,764

    I never use viewer so can't say.

    @hockeycrazy033 said:
    I built 90 percent of it on my windows machine. And it started as Ipad Portrait. But when i take it to mac it says ipad landscape idk why.

    I don't have a PC so can't check. but maybe just chack your setting and change it to iPad landscape.

  • hockeycrazy033hockeycrazy033 Member Posts: 14

    @BBEnk said:

    I don't think its the PC stuff. Honestly would you mind taking a quick look at my project.

    I think it has to do with some of the camera adjust stuff I did in your video. I deleted all the camera adjust stuff, and then gave everything static values, and it works on my iphone.

  • hockeycrazy033hockeycrazy033 Member Posts: 14

    I figured out if I do it as a 1 scene game without the intro the way yours was, it will show everything, but for some reason no background. I'm so confused.

  • BBEnkBBEnk Member Posts: 1,764
    edited April 2015

    Drop box me a link and ill have a look.

Sign In or Register to comment.