render

Render related functions

All of this functions must be run on this event for them to work

https://zarzel.gitbook.io/zarscript2/documentation/module/events#on_render_screen

render.rect

render.rect(x, y, x1, y1, r, g, b, a)

Argument

Type

Description

x

Number

X pos

y

Number

Y pos

x1

Number

End X pos

y1

Number

End Y pos

r

Number

Red 0-255

g

Number

Green 0-255

b

Number

Blue 0-255

a

Number

Alpha 0-255

Draws a filled rect on the screen

render.line

render.line(x, y, x1, y1, size, r, g, b, a)

Argument

Type

Description

x

Number

X pos

y

Number

Y pos

x1

Number

End X pos

y1

Number

End Y pos

size

Number

Line size

r

Number

Red 0-255

g

Number

Green 0-255

b

Number

Blue 0-255

a

Number

Alpha 0-255

Draws a line on the screen

render.player_head

render.player_head(x, y, size, entity_id)

Argument

Type

Description

x

Number

X pos

y

Number

Y pos

size

Number

Size of the player's head

entity_id

Number

ID of the entity to draw

Draws the player's skin head

render.circle

render.circle(x, y, degrees, rotation, diameter, r, g, b, a)

Argument

Type

Description

x

Number

X pos

y

Number

Y pos

degrees

Number

Degrees of the circle

rotation

Number

Rotation of the circle

diameter

Number

Circle size

r

Number

Red 0-255

g

Number

Green 0-255

b

Number

Blue 0-255

a

Number

Alpha 0-255

Renders a circle on your screen.

render.player

render.player(x, y, size, yaw, pitch, entity_id)

Argument

Type

Description

x

Number

X pos

y

Number

Y pos

size

Number

How big will the player be

yaw

Number

Yaw where the player will be looking

pitch

Number

Pitch where the player will be looking

entity_id

Number

ID of the entity to draw

Renders the full player on the screen

render.string

render.string(text, x, y, r, g, b, a)

Argument

Type

Description

text

String

Text to render

x

Number

X pos

y

Number

Y pos

r

Number

Red 0-255

g

Number

Green 0-255

b

Number

Blue 0-255

a

Number

Alpha 0-255

Renders text on your screen

render.string_shadow

render.string_shadow(text, x, y, r, g, b, a)

Argument

Type

Description

text

String

Text to render

x

Number

X pos

y

Number

Y pos

r

Number

Red 0-255

g

Number

Green 0-255

b

Number

Blue 0-255

a

Number

Alpha 0-255

Renders text with shadow on your screen

render.get_string_width

render.get_string_width(text): number

Argument

Type

Description

text

String

Text

Returns the width of the specified text

render.scale

render.scale(scaling)

Argument

Type

Description

scaling

Number

Scale multiplier

Scales the next drawing functions, for example, 2 multiplier will make the drawings twice as big

render.world_to_screen

render.world_to_screen(x, y, z): number, number, number

Argument

Type

Description

x

Number

X position

y

Number

Y position

z

Number

Z position

Returns the screen position of the desired coordinates

render.show_gui

render.show_gui(gui_table)

Argument

Type

Description

gui_table

Table

Table containing all the gui functions

This function is similar to the module_manager.register function, but instead of registering anything, it displays a custom GUI you can make. Further information for the events here

pageGUI Events

render.draw_image

render.draw_image(url, x, y, width height)

Argument

Type

Description

url

String

URL where the image is located

x

Number

X position

y

Number

Y position

width

Number

Width of image display

height

Number

Height of image display

Draws the image thats contained in the URL, for this method to work you must have enabled unsafe script functionality

Last updated