Hello Guest

Author Topic: Full width sprite scaling for mobile  (Read 3104 times)

kujo

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 12
    • View Profile
Full width sprite scaling for mobile
« on: December 06, 2013, 10:41:31 am »
Hi guys,

Working on some UI, and the design I have has a navigation bar (like iPhone) across the top of the screen. This works fine on iPhone, but when this goes onto iPad, the sprite doesn't fit on screen (its too short), and the buttons I put on there don't move. I have a 2D Toolkit camera in the scene, and I'm using an Upper Anchor to position the navbar at the top. I have a game object with a UILayout component on it and then the sprite itself. The anchors of UILayout are set to fill.

Whats the best way to handle this? its ok if the navigation bar sprite is stretched, but not the buttons.

Thanks.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Full width sprite scaling for mobile
« Reply #1 on: December 07, 2013, 03:22:24 pm »
If you have a UILayout on there, you can resize to fill the screen quite easily. Check UI Demo 2, keep clicking the button, it cycles between a few different sizes, one of them is fullscreen. The code is pretty simple in there.