Hello everyone,
Could some one help me to solve my problem and explain why?
I try to make a simple IU inventory of my player, what wanna i achive is
Have a single tab, when i click on it (or press a key) the tab should slide down and show the entire image, and then go up again.
The problem with this it everything gone wrong when i try in other aspect than 1920x1080
How i could achive this and also make this responsive for each resolution?
Also when i try to move the IU element with DOTween, i can move the element out of the canvas, but i can’t move it back if the player go around the map meanwhile.
If helps i set a canvas a Screen Space Camera (i have some 3d object on inventory so i need to use this),
I use an Image as inventory background (it also the item i want to move)
Try updating the Canvas Scalar settings on your Canvas to Fixed Size, or scale with screensize. Should help with different resolutions.
Ty for the quick response @SimonDarksideJ
With the canvas set as “Scale with Screen Size” it’s working, but how I can now slide the UI element off canvas and back in? I tried with rectTrasform Position but it’s not relative to the canvas, so if i move the player, when I try to slide the UI back in the canvas there go to old position of canvas
Edit:
I solve it with DOTween, and changing the AnchorPosition or RectTransform, but this is the better solution? or there is something better?
Have a panel as a child of the canvas, using it like an extra page. Then you can slide the panel in and out.
Hope that helps
Yeah same thing i did, but the problem is, Which Coordinate should i give to the panel when it slide out / in?
I can’t use the Width or Height couse those will change when resolution change, so i need some costant value in the Panel but what? neither canvas size could help me, maybe the anchors?
Plus on this i need the panel is a little bit visible, so a player can click on that so the panel could slide in.
1 Like