-
Notifications
You must be signed in to change notification settings - Fork 11
OryUIText
Kevin Cross edited this page Sep 11, 2019
·
6 revisions
Creates a text item and returns a text ID. See Available Parameters section below for the options.
Pins text A to the bottom center of sprite B.
Pins text A to the bottom left of sprite B.
Pins text A to the bottom right of sprite B.
Pins text A to centre left of sprite B.
Pins text A to centre of sprite B.
Pins text A to centre right of sprite B.
Pins text A to top centre of sprite B.
Pins text A to top left of sprite B.
Pins text A to top right of sprite B.
Updates a specific text item. See Available Parameters section below for the options.
Will wrap text to the desired width.
| Parameter | Description |
|---|---|
| alignment | The alignment of the content text. Accepts left, center, and right. Also accepts the numeric values 0, 1, and 2. |
| angle | The angle of the text. |
| bold | If the text is bold. Accepts the values true, false, 0, and 1. |
| color | The colour of the text. Accepts RGB values, and RGBA values (comma delimited) Also accepts MakeColor() value/id, and hex color codes. |
| depth | The depth of the text. |
| fixToScreen | Fixes the text to the screen. |
| position | The x and y position where the sprite should be placed, comma delimited. |
| size | The size of the text. Accepts decimals. |
| text | The text shown. |
| x | The x position where the text should be placed. |
| y | The y position where the text should be placed. |
Example
sprBox = OryUICreateSprite("size:50,20;color:44,62,80;offset:center;position:50,50")
txtSeconds = OryUICreateText("string:Seconds Running[colon];size:8;color:241,196,15;alignment:center")
OryUIPinTextToCentreOfSprite(txtName, sprBox, 0, 0)
do
OryUIUpdateText(txtSeconds, "string:Seconds Running[colon] " + str(GetSeconds()))
Sync()
loop
Example of OryUIWrapText()
txtLoremIpsum = OryUICreateText("string:" + OryUIWrapText("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin tortor arcu, interdum ac interdum eget, feugiat sed odio. Proin eu risus bibendum, varius turpis nec, euismod odio. Aliquam vel tortor erat. In hac habitasse platea dictumst. Ut in eros ut erat scelerisque sodales a eu diam. Ut sit amet libero dui. Morbi faucibus magna vel tortor porttitor, quis porta augue venenatis.", 3, 50) + ";size:3")
do
Sync()
loop