Author Topic: Problem with UILabel  (Read 3633 times)

bobobo

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
Problem with UILabel
« on: October 15, 2016, 02:04:40 AM »
This is the case, I want to reverse my whole game UI, so I did this to my camera:
camera.projectionMatrix * Matrix4x4.Scale(new Vector3(-1, 1, 1));
But I want to keep the UILabel text readable, so I did this to all the UILabel:
label.transform.Rotate(new Vector3(0, 1, 0), 180);

However, many text seems like they are sheltered by the background. And when I remove the rotation to labels the text come back.
And if I modify the rotation at runtime through inspector, it behavies good.
Could anyone figure me out what's the problem ?
« Last Edit: October 15, 2016, 02:55:17 AM by bobobo »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Problem with UILabel
« Reply #1 on: October 17, 2016, 10:18:56 PM »
I'm pretty sure that when you rotate the transform like that, you rotate it around the world origin. Either set the label's rotation directly, or better yet set its local scale to (-1, 1, 1) like you do with the projection matrix.