Translations:UIX/23/en
Jump to navigation
Jump to search
- Add a child to your canvas (or layout or whatever) and call it Button.
- In that object, Attach Component > UIX > Graphics > Image. You can change the image's Tint to change the base color of the button.
- Change the RectTransform's AnchorMin/Max to add a border around the button. This effectively tells the parent where the child is and how to scale it.
- AnchorMin (x,y) is the lower left corner of a rectangle on the parent canvas that the child should be fit into, ranging from 0 to 1. (0,0) is the lower left of the parent.
- AnchorMax (x,y) is the upper right corner of a rectangle on the parent canvas that the child should be fit into, ranging from 0 to 1. (1,1) is the upper right of the parent.
- Adding a small border of, say, 5% of the parent's size, means the AnchorMin should be (0.05,0.05) (i.e. 0,0 plus 5%) and AnchorMax should be (0.95,0.95) (i.e. 1,1 minus 5%).
- Attach Component > UIX > Interaction > Button. Based on the image's Tint, the button will automatically fill out the colors for its normal, highlight, press, and disabled states.
- You may add text to the button:
- Create a child object of the button and call it Text.
- On that child, Attach Component > UIX > Graphics > Text.
- Change the text to what you want.
- Alter the font size, set up autosize, change the alignment to what you want.
- You can hook the button up to LogiX by creating a Button Events node, dragging out the Button interface card, and hooking it up to the Button Events node.