#UI UX help

1 messages · Page 1 of 1 (latest)

trail zenith
#

So I'm making a 'resizable window' and the idea is that if you get an IDragHandler call, check if it's above one of these 8 handler areas, and then change the anchor and size of the window.

#

However, it seems the only thing it can collide with is a spriterenderer, but I don't want the handles visible (think of how windows are resized on windows and such, just off of the window).

Is there a way to make these GraphicRaycasts hit these objects, or is such a thing not a good use for the module?

lavish chasm
# trail zenith However, it seems the only thing it can collide with is a spriterenderer, but I ...

My first initial thoughts would be to maybe give it a image anyway and just set the sprite to nothing, and the alpha to 0 so its not visible, or you could maybe give it a 2D collider and try to treat it like a regular sprite, or you could store the bounds of the RectTransform, and use a mouse position check to figure out how close to the edge it is from a specific side, and do your resizing from there, theres also Bounds.ClosestPoint I believe its called, so you could pass in the mouse position to that and see how far from the closest point and actual point the mouse is, and decide if its large/small enough to consider "resizable"

trail zenith
#

Those were some of my ideas, but I haven't heard of Bounds.ClosestPoint. Could it be used on my vertical/horizontal portions?

#

Actually, I might look at that sprite solution. Clunky, but usable.

#

Oh! Works!

lavish chasm
trail zenith
#

I will take a look, then. Thanks

lavish chasm
#

Np