Hello Guest

Author Topic: Screen Anchors for UI  (Read 5718 times)

fryza

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 22
    • View Profile
Screen Anchors for UI
« on: March 14, 2014, 08:14:05 pm »
Is there a way to position items at top left, top middle, top right, bottom left, etc,etc,etc of the screen edges?

Something that supports both retina and non retina resolutions? Also something that has an x and y offset?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Screen Anchors for UI
« Reply #1 on: March 15, 2014, 11:18:32 am »
tk2dCamera anchors should work fine for UI.

fryza

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: Screen Anchors for UI
« Reply #2 on: March 17, 2014, 04:09:51 pm »
Is it possible to use the camera anchors without using the tk2dcamera features.

My problem is i don't want any overrides and i dont want the camera to squish or stretch things. I just want a default orthographic camera. Im doing a mobile game and using the tk2dcamera i can not get every resolution to look good. It either squishes iphone 5 or makes ipad too small. I could add specific overrides, but we are also building this for android and a ton of devices.

What is the best practice here to support multiple resolutions?

The best fit so far has been to not use the tk2dcamera feature - i just place the objects at different places on the screen that support both phones and tablets and it seems to work great. But I need the camera anchors to do this.

So how can i turn off all tk2dcamera features while still using the anchors?

fryza

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: Screen Anchors for UI
« Reply #3 on: March 17, 2014, 05:24:36 pm »
I'm really going crazy here.

Can you help me understand what I am seeing here.

I don't want anything squished or stretched. When it is a tablet i want it to show the full background/screen size. When it is a phone, just clip the background on the left and right. I can't seem to get tk2dcamera to do that. Can you help me understand?


unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Screen Anchors for UI
« Reply #4 on: March 17, 2014, 09:21:13 pm »
The tk2dCameraAnchor works fine without the tk2dCamera. Just select your camera, Create > tk2d > Camera Anchor.
If you want to use the tk2dCamera and have it behave like a normal camera, switch to Overrides and change the default override from Fit Visible to Fit Height.