[Lua Utility] Custom Gui Utility

  • Download count 3
  • Pageviews 60
  • Unique foldername
  • Skin for
  • Track Mod for
  • Based on
  • Release date 2026-04-19
  • Version from
  • Version
  • RVW-ID 46769
  • Category
  • Score
    Not enough votes
  • Unconventional car?
  • Construction
  • Engine
  • Transmission
  • Top speed mph
  • Total weight kg
  • Acceleration m/s²
  • Construction
  • Track difficulty
  • Track length m
  • Reverse version available?
  • Time trial times available?
  • Practice mode star available?
  • Online multiplayer compatible?

    NOTE: You need lua modloader for this modification
    link: https://www.revoltworld.net/dl/rvgl-lua-modloader/

    this is a script utility library that adds new functions to easly draw custom GUI elements. An example script that showcases all the functions is also included.

    _________________________________
    how to include these utilities in your lua script:
    copy the following on top of your lua script:

    --@require custom_gui_utility.lua
    local draw_frame = ml.get_shared_function("custom_gui_utility::draw_frame")
    local draw_frame_text_box = ml.get_shared_function("custom_gui_utility::draw_frame_text_box")
    local draw_panel = ml.get_shared_function("custom_gui_utility::draw_panel")
    local draw_carbox_by_model = ml.get_shared_function("custom_gui_utility::draw_carbox_by_model")

    _________________________________
    functions in this script utility library:

    draw_frame(x, y, w, h, r, g, b, a, thickness)
    Draws a GUI frame using the original game sprite sheet, in the specified xy position and with the specified width and height.
    Thickness is used to change the thickness of the frame borders, 1.0 will look like most of the original GUIs in the game.
    You can also use custom color for it, but if you want to replicate the original colors here are the values:
    blue 42, 59, 187
    yellow 230, 194, 0
    red 177, 55, 61

    draw_panel(x, y, w, h, r, g, b, a, thickness)
    Draws a GUI panel using the original game sprite sheet, in the specified xy position and with the specified width and height.
    Same arguments as draw_frame ... the only difference between panel and frame is that the panel has solid color background.

    draw_frame_text_box(text, x, y, pad_x, pad_y, r, g, b, a, font_size)
    This is an extended version of draw_frame that on top of drawing the frame also draws the semi transparent background in it and writes text in it.
    In this case the width and height are calculated automatically depending on the text written in the frame.
    You can use pad_x and pad_y to change the distance between the text and the edges of the frame.

    draw_carbox_by_model(model_id, x, y, w, h, r, g, b, a)
    Draws a carbox image by car model_id, handling both sprite sheets (for stock cars) and single images (for custom cars).


Leave a comment