Author Topic: Game multiple resolution  (Read 4289 times)

salvokt

  • Guest
Game multiple resolution
« on: May 05, 2012, 10:07:53 AM »
I'm want help for don't change the menu when changing resolution.
this is an example 1024x768

at 1366x768 (my predefinited resolution)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Game multiple resolution
« Reply #1 on: May 05, 2012, 11:17:34 AM »
You are talking about the aspect ratio here, not resolution.

Use UIAnchor to attach things to the left side of your screen, and another UIAnchor to attach things to the right side.

salvokt

  • Guest
Re: Game multiple resolution
« Reply #2 on: May 05, 2012, 01:04:31 PM »
sorry but how i do this?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Game multiple resolution
« Reply #3 on: May 05, 2012, 01:10:17 PM »

salvokt

  • Guest
Re: Game multiple resolution
« Reply #4 on: May 05, 2012, 07:03:01 PM »
how i set a custom anchor position?

salvokt

  • Guest
Re: Game multiple resolution
« Reply #5 on: May 06, 2012, 07:23:32 AM »
any help?

Sarus

  • Guest
Re: Game multiple resolution
« Reply #6 on: May 06, 2012, 08:26:08 AM »
Where exactly are you trying to anchor things?

Based on the screenshot above if you want to anchor your menu options to the bottom left then attach a UIAnchor script to an empty GameObject in your UIRoot hierarchy.

Set the side property on the UIAnchor script to "BottomLeft" to anchor any widgets under the GameObject to the bottom of the screen.  Just place your widgets under the GameObject with the UIAnchor script (buttons, sprites etc.).   At this point you can just move the widget around and it will always be the correct fixed number of pixels from the "BottomLeft" of the screen.  So if you put a widget under the anchor gameobject and move it 20 pixels to the right, it will always appear 20 pixels to the right of the bottom left screen edge.

Do the same thing for the items you want on the right of the screen except set the side property on the UIAnchor script to "BottomRight"  (or just Right if want it centered)

Video Tutorial:  http://www.tasharen.com/ngui/vt2/

This tutorial video ArenMook did also shows basic usage of UIAnchor.  Note that the video is using an older version of NGUI so the stretch to fill option is now handled with the UIStretch script (but the video should still give you an idea of how to use UIAnchor).
« Last Edit: May 06, 2012, 08:28:20 AM by Sarus »