The "vngen_textbox_modify_direct" Function

Syntax

vngen_textbox_modify_direct(id, x, y, z, xscale, yscale, rot);
ArgumentTypeDescription
idreal/stringThe ID of the textbox to modify (or keyword all for all textboxes)
xrealThe horizontal position to display the textbox, relative to the global offset
yrealThe vertical position to display the textbox, relative to the global offset
zrealThe drawing depth of the textbox, relative to other textboxes only
xscalerealThe horizontal scale multiplier, where 1 is default
yscalerealThe vertical scale multiplier, where 1 is default
rotrealThe textbox rotation, in degrees

Description

Applies a new position, orientation, and scale to the input entity ID directly, outside the qScript loop.

All modifications made with this script are permanent and will persist until another modification is performed.

As this script is not an action, care should be taken in deciding when and where to execute it. If both *_modify and *_modify_direct scripts are executed together, whichever is run last will override the other.

Example

var mx = window_mouse_get_x() - (window_get_width()*0.5);
var my = window_mouse_get_y() - (window_get_height()*0.5);
if (mouse_check_button(mb_left)) {
vngen_textbox_modify_direct("tb", mx, my, 0, 1, 1, 0);
}

This will map the textbox to the mouse, allowing the user to click and drag the textbox to a new position on the screen.