Skip to content

OryUIText

Kevin Cross edited this page Sep 11, 2019 · 6 revisions

Available Functions

OryUICreateText(parameters$)

Creates a text item and returns a text ID. See Available Parameters section below for the options.

OryUIPinTextToBottomCentreOfSprite(textA, spriteB, offsetX#, offsetY#)

Pins text A to the bottom center of sprite B.

OryUIPinTextToBottomLeftOfSprite(textA, spriteB, offsetX#, offsetY#)

Pins text A to the bottom left of sprite B.

OryUIPinTextToBottomRightOfSprite(textA, spriteB, offsetX#, offsetY#)

Pins text A to the bottom right of sprite B.

OryUIPinTextToCentreLeftOfSprite(textA, spriteB, offsetX#, offsetY#)

Pins text A to centre left of sprite B.

OryUIPinTextToCentreOfSprite(textA, spriteB, offsetX#, offsetY#)

Pins text A to centre of sprite B.

OryUIPinTextToCentreRightOfSprite(textA, spriteB, offsetX#, offsetY#)

Pins text A to centre right of sprite B.

OryUIPinTextToTopCentreOfSprite(textA, spriteB, offsetX#, offsetY#)

Pins text A to top centre of sprite B.

OryUIPinTextToTopLeftOfSprite(textA, spriteB, offsetX#, offsetY#)

Pins text A to top left of sprite B.

OryUIPinTextToTopRightOfSprite(textA, spriteB, offsetX#, offsetY#)

Pins text A to top right of sprite B.

OryUIUpdateText(textID, parameters$)

Updates a specific text item. See Available Parameters section below for the options.

OryUIWrapText(text$, textSize#, wrapWidth#)

Will wrap text to the desired width.

Available Parameters (all optional)

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 Code

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

Clone this wiki locally