The "vngen_set_halign" Function

Syntax

vngen_set_halign(id, type, halign);
ArgumentTypeDescription
idreal/stringThe ID of the entity to set alignment  (or keyword 'all' for all entities)
typeinteger/macroSets whether to set alignment for text or labels
halignconstantSets font alignment to either fa_left, fa_center, or fa_right (default fa_left)

Description

Sets the horizontal alignment of the specified text or label entity. It is also possible to permanently set alignment of all entities of either type by supplying the 'all' keyword in place of an ID. In this case, alignment will also apply to new entities created in the future.

See Macros & Keywords for a full list of available entity types. This script supports only the entity types vngen_type_text and vngen_type_label.

Example

vngen_set_halign("text", vngen_type_text, fa_center);
vngen_set_halign(all, vngen_type_label, fa_left);
note

Note: VNgen alignment properties exist independently of GameMaker's draw_set_halign property. Changing VNgen alignment will not affect GameMaker's alignment and vice versa.