Easier UI
Fernando Medina
$10.00
Date |
Price |
---|---|
日期和时间 |
价钱($) |
03/19(2018) |
3.99 |
07/29(2019) |
10.0 |
11/08(2024) |
10.0 |
Jump AssetStore
Also works with Unity 4.6
This asset simplifies the work when programming with position and size of UI objects, so you can focus on your game and not in the UI coordinate problems.
Adds new methods to RectTransform.
Why this is needed:
The Unity UI system is excellent to solve the problem of different screens easily, but this complicates other things. This tool makes easy the complicated things.
With this tool you can:
- Set and get position and size of an object using values relative to the parent (and not relative to the anchors).This is like a "move this ignoring anchors" feature. With this you know and set the real size and position of UI elements with simple values just like x, y, with and height.
- Set and get position and size of an object or it's anchors with canvas coordinates. To move an object like if it were a direct child of the canvas when is not. Useful in animations or to visually match objects located inside different containers.
- Use values from 0 to 1 to move the object exactly out of it's container or out of the screen when setting 0 or 1 (see the video). Useful to animate an object out of the screen without thinking about math, anchors, position, size or containers
- Move or resize the object or it's anchors using screen space coordinates (pixels). Useful for mouse/touch interaction that changes UI objects or to visually match UI objects with 3D or 2D objects.
- Other coordinarte systems to move and resize.
- Set the pivot position from code without braking the position of the object and with different coordinate systems like the ones mentioned before.
- Change and get anchors position and size using a Vector2 for position and another Vector2 for size. (An alternative to AnchorsMin and AnchorsMax) Specially useful for animating anchors with tween libraries. For example, to only change position of anchors you can animate a single position value, otherwise for doing the same you have to animate both AnchorMin and AnchorMax values in 2 different tweens.
Limitations:
- Rotated UI objects are not supported.
- Scale values different than 1 still breaks the relation between the apparience of the object and the numbers (just like when not using this tool).
- Pixel coordinates does not work with a "3D UI" (Word space canvas UI) unless is full screen like a normal UI.
Usage:
This is a programming tool. It comes with the "Rect Transform Extended" component but only for testing and understanding. When you import the asset new methods are added to RectTransform. Everything is documented and an example scene is included. A very clean source code ready to be extended is also included.
Feedback:
For questions or suggestions use the Forum thread
where you can also find my e-mail for any other kind of feedback.
You are free to use these tools in a game or app release or another asset as a part of it.