Hello Guest

Author Topic: Same Text/Sprite size for in either Landscape or Potrait orientation  (Read 4551 times)

wei2lee86

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 4
    • View Profile
I have 2d toolkit project setup for iPhone, iPad.
My problem is : when the device orientation change, the Sprite/Text become smaller.

I am aware of it is default behavior for 2d toolkit for supporting multiple screen resolution (its aspect fit my Native Resolution to actual Screen resolution)
However in this project I need the text to remain same size in either device orientation (I will setup all of my Sprite/Text in the center portion of the Screen)

Please help me to keep text/sprite same size in either device orientation.

*I am not looking for make the Sprite/Text Same size from photoshop to Unity
I am looking for how to make it same size on screen between orientation. Please see attachment "Landscape", "Potrait", the Text has different on screen size.
« Last Edit: May 17, 2014, 10:29:43 am by wei2lee86 »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Set it to pixel perfect and it will be the same size regardless of orientation.

wei2lee86

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 4
    • View Profile
Can you explain more about "make pixel perfect" ? How ?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
In the overrides page of the tk2dCamera, set the scale mode to pixel perfect. That will make the text pixel perfect at any resolution.

wei2lee86

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 4
    • View Profile
I need to support resolution for iPhone4~5, iPad2~iPad4, all for landscape,potrait orientation, and I have some Text/Sprite i wish to remain scaling behavior as Aspect Fit

Is there a way that this setting only affect certain Text/Sprite ?

What I wish is, everything will "visible aspect fill", but certain Text/Sprite remain same size(as aspect fited) in either landscape/potrait.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
The easiest way is to create a second camera that can only see the text. You can set up different scaling options for each camera. Make sure the second camera doesn't clear depth or color, and the camera "Depth" is > the first camera.

wei2lee86

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 4
    • View Profile
Thanks for your help!
My final setup:
First camera = visible fit, native resolution 768x1024, showing normal sprite and text
Second camera = visible fit, native resolution 1024x1024, showing sprite/text that need to keep same size in Landscape/Potrait, and position it in center portion of camera