Hello Guest

Author Topic: Supporting multiple devices  (Read 8596 times)

vambier

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 35
    • View Profile
Supporting multiple devices
« on: October 24, 2012, 09:10:16 am »
I'm making a game with your toolkit and want to get it on as many devices as possible.
Currently we're developing for ipad1, ipad2 and since yesterday ipad mini :) since these are all 1024x768 screens.

We also want to get our game on the older iphones/ipods, iphone 5 and ipad 3/4 but these all got different screen resolutions.
Eventually we also want to get it to the pc/mac but I'm guessing that will require the same steps(correct me if I'm wrong)

I have no idea how to do this in unity/2d toolkit, you got any pointers for me about how to achieve this?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Supporting multiple devices
« Reply #1 on: October 24, 2012, 09:24:57 pm »
Really depends on how you have your scene set up. Do you use tk2dCamera or just a normal ortho camera?

vambier

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 35
    • View Profile
Re: Supporting multiple devices
« Reply #2 on: October 24, 2012, 09:29:46 pm »
I use tk2dCamera

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Supporting multiple devices
« Reply #3 on: October 24, 2012, 10:23:20 pm »
Add a default resolution override (wildcard override) as shown here, and your game will automatically fit whatever resolution it runs on. Thats a good start, I suppose. Beyond that, it really depends on what you want to do.

vambier

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 35
    • View Profile
Re: Supporting multiple devices
« Reply #4 on: October 25, 2012, 08:05:31 am »
Well there lies the problem. I'm developing on 1024x768, but when I add an override for say 480x320 I only see the bottom left corner of my screen, so it seems like the view is not scaling back. Same when I set it to a higher resolution but then I see my game screen in the bottom left corner with a lot extra space around it.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Supporting multiple devices
« Reply #5 on: October 25, 2012, 09:35:25 am »
Just adding the default override (-1, -1 fit center) will make it fill the screen. How have you got it set up?

vambier

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 35
    • View Profile
Re: Supporting multiple devices
« Reply #6 on: October 25, 2012, 09:37:45 am »
Thanks, I will give that a try.
Do you mean the setup of my tk2dCamera?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Supporting multiple devices
« Reply #7 on: October 25, 2012, 10:11:03 am »
Yes

vambier

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 35
    • View Profile
Re: Supporting multiple devices
« Reply #8 on: October 25, 2012, 10:53:41 am »
I'll have to check the settings when I get back from work.
But I just used a basic tk2dCamera with the override set to 1024x768 and created an anchor which is the parent for all my other sprites in the scene.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Supporting multiple devices
« Reply #9 on: October 25, 2012, 12:07:10 pm »
Don't set a fixed override, just delete it and create a new one. Leave it at defaults.

vambier

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 35
    • View Profile
Re: Supporting multiple devices
« Reply #10 on: October 25, 2012, 12:22:29 pm »
Thanks! I'll try that first thing tonight

vambier

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 35
    • View Profile
Re: Supporting multiple devices
« Reply #11 on: October 26, 2012, 08:31:31 am »
I tried it and it works! But since I'm developing at a resolution of 1024x768 I get two black borders on the side of the iphone, is it possible to stretch the image so that it fits the screen? I know my image won't be the same but it's better than the black borders.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Supporting multiple devices
« Reply #12 on: October 26, 2012, 10:53:19 am »
That's not something I want to support out of the box due to the pandoras box of support issues its going to open up. There will be pretty horrible artefacts in some circumstances due to how everything gets scaled into non-square pixels - it could also end up picking incorrect mips for objects with mipmaps ending up with blur results. If you still want to do this, drop me an email and I'll tell you what lines to change, but keep in mind its unsupported :)

vambier

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 35
    • View Profile
Re: Supporting multiple devices
« Reply #13 on: October 26, 2012, 03:34:36 pm »
I mailed you about this:-)