Author Topic: Offset anchor by position  (Read 4367 times)

PauliusLiekis

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 8
    • View Profile
Offset anchor by position
« on: September 07, 2015, 03:26:26 AM »
Hi,

I'm having problems with "Offset anchor by position" feature on UIPanel. The problem seems to appear on objects which are NOT anchored to anything.

Example 1

See attached Separators.png. The shown panel moves into the screen from the bottom. It is moved by changing its position and using "Offset anchor by position".

As you can see from the screenshot the labels move in fine, but the separators stay somewhere behind. Labels are anchored to the panel and separators are not.

Example 2

See attached Panel images. In this case window moves in from the right. In this case the whole inner panel is offset to the left (which is counter intuitive - I would expect it to be off to the right, because I though it's caused by some kind of one frame delay). Anyway, it should be centered in the middle. Even more interesting that you can see in the scene view that rendering of gizmos are positioned in correct place, but the generated quads in UIDrawCalls are off to the left.

I marked parent panel with Blue. Child panel visually should be in green position, but it is in red.

Setting up anchors on objects properly doesn't solve the problem. If I remove child UIPanel, i.e. all objects live in the same UIPanel, then everything works (except that I can not do ScollViews :))


Could you tell me if there is a workaround to this problem? Maybe there is a better way to move windows from code?

« Last Edit: September 07, 2015, 04:56:12 AM by PauliusLiekis »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Offset anchor by position
« Reply #1 on: September 13, 2015, 05:01:38 AM »
Objects that are not anchored to anything... hmm -- what are they children of then? And what's the panel anchored to, the screen? I'd need more details or maybe a simple repro case to look at to understand this better.

PauliusLiekis

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 8
    • View Profile
Re: Offset anchor by position
« Reply #2 on: September 13, 2015, 03:05:27 PM »
Email with a repro case sent.

PauliusLiekis

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 8
    • View Profile
Re: Offset anchor by position
« Reply #3 on: September 13, 2015, 03:11:35 PM »
kLOL. I just found the problem for my Example #1 (the repro case that I sent you, so you can ignore that). There was a non-zero value on y position on MenuPage_Main transform, i.e. the panel that I'm trying to offset.

I'll try to create a repro case for problem #2.

PauliusLiekis

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 8
    • View Profile
Re: Offset anchor by position
« Reply #4 on: September 13, 2015, 04:57:55 PM »
Sent an email with repro case for Example #2.