Draw

CLIENT SIDE ONLY

Small selection of useful draw functions.

Functions

draw_text

Draws text with advanced customisation.

--- Utils object
utils.draw.text({
    coords = vector3(0.5, 0.5, 0.0),
    content = 'Hello, World!',
    scale = 0.5,
    colour = {255, 255, 255, 255},
    font = 4,
    alignment = 'center'
})

--- Direct export
exports.boii_utils:draw_text(...)

draw_rotated_box

Draws a rotated box using lines.

--- Define corners
local corners = {
    vector3(0, 0, 0),
    vector3(1, 0, 0),
    vector3(1, 1, 0),
    vector3(0, 1, 0)
}

--- Utils object
utils.draw.draw_rotated_box(corners, {255, 0, 0, 255})

--- Direct export
exports.boii_utils:draw_rotated_box(...)

draw_3d_cuboid

Draws a 3D cuboid with edges.

--- Define center
local center = vector3(0, 0, 0)
--- Define dimensions
local dimensions = { width = 2.0, length = 2.0, height = 3.0 }
--- Define heading
local heading = 45.0
--- Define line colour
local colour = {0, 255, 0, 255}

--- Utils object
utils.draw.draw_3d_cuboid(center, dimensions, heading, colour)

--- Direct export
exports.boii_utils:draw_3d_cuboid(center, dimensions, heading, colour)

draw_movie

Plays and draws a BINK movie on screen.

--- Define handle
local handle = LoadBinkMovie('define movie here')
--- Define coords
local coords = {x = 0.5, y = 0.5}
--- Define scale
local scale = {x = 0.8, y = 0.6}
--- Define rotation
local rotation = 0.0
--- Define colour
local colour = {255, 255, 255, 255}


--- Utils object
utils.draw.movie({
    bink = bink_handle,
    coords = coords,
    scale = scale,
    rotation = rotation,
    colour = colour
})

--- Direct export
exports.boii_utils:draw_movie(...)

draw_scaleform_movie

Draws a scaleform movie

--- Define mode
local mode = 'fullscreen'
--- Define scaleform
local scaleform = RequestScaleformMovie('define movie here')
--- Define colour
local colour = {255, 255, 255, 255}

--- Utils object
utils.draw.scaleform_movie({
    mode = mode,
    scaleform = scaleform,
    colour = colour
})

--- Direct export
exports.boii_utils:draw_scaleform_movie(...)

draw_interactive_sprite

Draws an interactive sprite on screen.

--- Define texture dict
local texture_dict = 'commonmenu'
--- Define texture name
local texture_name = 'arrowright'
--- Define coords
local coords = vector3(0.5, 0.5, 0.0)
--- Define size
local size = {width = 0.05, height = 0.05}
--- Define rotation
local rotation = 45.0
--- Define colour
local colour = {255, 255, 255, 255}

--- Utils object
utils.draw.interactive_sprite({
    texture_dict = texture_dict,
    texture_name = texture_name,
    coords = coords,
    size = size,
    rotation = rotation,
    colour = colour
})

--- Direct export
exports.boii_utils:draw_interactive_sprite(...)

draw_sprite_poly

Draws a sprite polygon in the world.

--- Define vertices
local vertices = {
    vector3(0, 0, 0),
    vector3(1, 0, 0),
    vector3(0, 1, 0)
}
--- Define texture dict
local texture_dict = 'deadline'
--- Define texture name
local texture_name = 'deadline_trail'
--- Define UVW
local UVW = {{0.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {0.0, 1.0, 0.0}}
--- Define mode
local mode = 'single'
--- Define colour
local colour = {255, 0, 0, 255}

--- Utils object
utils.draw.sprite_poly({
    vertices = vertices,
    texture_dict = texture_dict,
    texture_name = texture_name,
    UVW = UVW,
    mode = mode,
    colour = colour
})

--- Direct export
exports.boii_utils:draw_sprite_poly(...)

draw_light

Draws a light with optional shadows.

--- Define coords
local coords = vector3(0, 0, 5)
--- Define colour
local colour = {0, 255, 255}
--- Define range
local range = 10.0
--- Define intensity
local intensity = 5.0
---- Define shadow
local shadow = 2.0

--- Utils object
utils.draw.light({
    coords = coords,
    colour = colour,
    range = range,
    intensity = intensity,
    shadow = shadow
})

--- Direct export
exports.boii_utils:draw_light(...)

Last updated