Skip to content

Commit

Permalink
Update UI Control Transform docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mafiesto4 committed Feb 26, 2024
1 parent 115f759 commit ab74924
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 9 deletions.
Binary file added manual/ui/control/media/anchor-presets.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed manual/ui/control/media/anchor_presets.png
Binary file not shown.
Binary file added manual/ui/control/media/control-transform.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 17 additions & 8 deletions manual/ui/control/transform.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,24 @@
# Control Transform

![UI Control Transform](media/control-transform.png)

Every GUI control contains a set of properties related to transforming the control within the parent container. Every control location can be assigned and fixed, or depend on the parent container controls dimensions. Use the properties group **Transform** when editing selected **UI Control** in the editor to adjust its appearance. All these options can also be modified at runtime from C# code.

## Anchor

![Anchor Presets](media/anchor-presets.png)

The control has *anchor min* and *anchor max* properties which can be set manually or via the *Anchor Presets* editor. The control anchors are normalized (to range `0-1`) position in the parent control that the upper left and bottom right corners.

This can be used to dock control inside the parent container so control location/size can depend on parent container bounds.

Additional features:
* Hold *Shift* key to update control bounds to the certain anchor preset (eg. quickly fill the parent control area),
* Hold *Control* key to update the pivot point to the certain anchor preset (eg. to rotate the control around it).

> [!Tip]
> A small `X` button under the control's `Height` field can be used to toggle UI control resizing based on where the pivot is rather than just the top-left.
## Location

The location of the upper-left corner of the control relative to the upper-left corner of its container.
Expand Down Expand Up @@ -37,11 +54,3 @@ The shear transform angles (x, y). Defined in degrees.
The control rotation angle (in degrees).

![Rotation](media/rotation.jpg)

## Anchor

The control has *anchor min* and *anchor max* properties which can be set manually or via the *Anchor Presets* editor. The control anchors are normalized (to range 0-1) position in the parent control that the upper left and bottom right corners.
This can be used to dock control inside the parent container so control location/size can depend on parent container bounds.

![Anchor Presets](media/anchor_presets.png)

4 changes: 3 additions & 1 deletion manual/ui/tutorials/blur-background.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ For the newly created GUI we will use a `Blur Panel` control. To do so, select t

## 4. Adjusting the panel

Now, set the **Blur Strength** to **8** for example and adjust the **bounds** of the control to cover the whole background of the interface (you can use *Dock Style* set to *Fill*).
![UI Control Stretch All](media/ui-stretch-all.png)

Now, set the **Blur Strength** to **8** for example and adjust the **bounds** of the control to cover the whole background of the interface (you can use *Anchor Presets* set to *Stretch All* with *Shift* key pressed down to update bounds).

## 5. See the results

Expand Down
Binary file added manual/ui/tutorials/media/ui-stretch-all.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ab74924

Please sign in to comment.