Forum rules - please read before posting.

Unity UI Prefab - RectTransform boundary

edited January 2015 in Technical Q&A
I have a canvas at 0,0,0 with a child panel at 0,0,0. My menu is assigned such that the Linked Canvas is the canvas and the recttransform boundary is the panel.

If I choose Appear type: Mouse over, I expect to move my cursor to the top of the screen and my menu will appear. The bug is that if I am at the top-most pixel of the boundary on the y axis (0), it interprets this as not being over the boundary area. In other words I just move my mouse to the top of the screen as far as it can go. I had to assign the canvas a y value of 0.0001 in order to avoid this issue. Thus it makes the pnael 0.0001 off the screen of the camera. I imagine that AC would want to support recttransforms on mouse over even at 0,0,0 positions.

Comments

  • Sorry, I'm having trouble visualising this - what's the size of the panel?  Could you post a shot?
  • edited January 2015
    So I was getting you some screenshots and found out its an editor only bug. I force an aspect ratio of 1.6. Set 16:10 in the game view. Run and move the mouse to the top. You'll have the inventory menu appear. Move the cursor left or right and you will notice it will turn on and off.

    If you don't set the aspect ratio the cursor can go off the screen and thus have the menu turn off. That makes total sense. Its just the forced aspect ratio in the game window makes the top of the window the end of the game window and apparently it has trouble with interpreting the cursor being in 0 on the y around there as it moves left to right. I assumed that was how it would work in a build before posting. I tested a build in game and it worked fine. Speaking of which, is there a way to force the mouse to stay within the screen when using Force Aspect ratio?

    It is interesting that by moving my panel 0.001 it corrects this in the editor.

    image
    image

  • Whether this is a quirk of Unity, the UI, or AC, I'm not really sure - but if the 0.0001 fixes it, fair enough.  I don't believe the cursor can be limited to the window's boundary, though.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.