The "vngen_object_draw" Function
vngen_object_draw(x, y, speed, highlight);
|x||real||The global horizontal offset for displaying all VNgen entities|
|y||real||The global vertical offset for displaying all VNgen entities|
|speed||real||The global speed multiplier for all sprite animations in the current object|
|highlight||boolean||Enables or disables highlighting the current speaking character(s)|
Draws all VNgen entities and governs a number of animation properties. Must be run in the Draw Event of each object containing VNgen code.
Note: It is also possible to draw VNgen in the Draw GUI Event, however this is not recommended.
While each VNgen entity possesses its own unique coordinates, this script can be used to also set global coordinates which determine where in the room VNgen appears as a whole. This is extremely useful when combining visual novels with other genres, as you may wish for your VNgen elements to appear where other game elements are physically located in the room. Another option is to draw VNgen in the GUI Event as opposed to the normal Draw Event, in which case the global offset can be set to 0, 0―no individual action coordinates must be altered to switch between drawing processes.
Like vngen_log_draw, vngen_object_draw uses an animation speed multiplier to adapt sprite-based animations to any framerate. VNgen is designed for a base framerate of 60 FPS, meaning a 1x speed multiplier will assume all sprites are rendered with 60 FPS animations. However, sprites require memory and page flipping, meaning such high-framerate animations can quickly consume performance. It may be preferable to use 30 FPS sprites or less, but in a 60 FPS game these sprites will appear to run at double speed. In this case, setting the global animation speed multiplier to 0.5x will cause sprites to play back at normal speed while the rest of the game continues to operate at 60 FPS (or any other framerate―as 60 FPS is assumed, in this example the multiplier should still be 0.5 even if room speed is set to 30).
Additionally, VNgen characters are drawn with built-in fade/highlight support to emphasize who is currently speaking. If the name of a speaker set in vngen_text_* functions matches that of an active character, that specific character will be highlighted while all others are dimmed. This behavior is optional, however, and must be enabled or disabled in this script to function.
Example: vngen_object_draw(view_xview, view_yview, 0.5, true);