Hello Guest

Author Topic: UIProgressBar and Camera Anchor strange behaviour  (Read 3473 times)

alkaszl

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 4
    • View Profile
UIProgressBar and Camera Anchor strange behaviour
« on: May 23, 2014, 03:27:38 am »
When I attach a progress bar UI element to a camera anchor, it is producing very strange results. The anchor, while displaying the right coords in the transform in the inspector, does not match its actual location on screen. All the other UI elements are properly anchoring, but progress bar seems to be really wonky and won't anchor correctly. I am just using the premade control prefabs included in the toolkit, with an ortho camera with orthographic size set to 1.

I don't know what I need to do to make it properly anchor to the right screen position :S

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: UIProgressBar and Camera Anchor strange behaviour
« Reply #1 on: May 23, 2014, 01:55:24 pm »
What do you mean by it doesn't anchor correctly? Can you post the example scene you're using here? Just the scene file will suffice if you're using default tk2d assets

alkaszl

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: UIProgressBar and Camera Anchor strange behaviour
« Reply #2 on: May 23, 2014, 02:35:36 pm »
I discovered it is anchoring not to the correct pivot of the progressbar (center) but instead to the furthest left bounds of it. I think it is working, I just have to set the appropriate offset so the progressbar anchors to its center.

edit: however, it appears to have different behaviour than the previously posted screencap. Who knows, but it seems to be fine now!