Skip to content

outline_drawer

Grisgram edited this page May 12, 2022 · 3 revisions

The outline_drawer is easy to instanciate and use. There is only one method you really need to draw an object outlined.

Creating an outline_drawer

outliner = new outline_drawer(0, outline_color, outline_alpha, outline_strength, outline_alpha_fading);

The parameters for the constructor are:

Name Expected type Default Description
_viewport int 0 The viewport to use (camera will be taken from there).
_outline_color color c_white The color to draw the outline.
_outline_alpha real 0..1 1 If no alpha_fading is active, this is the alpha value the outline will be drawn with.
_outline_strength real 3 The width in pixels of the outline.
_alpha_fading bool true If true, _outline_alpha will be ignored, instead the outline is drawn with a decreasing
alpha value that creates great visual effects as the outline fades away.
Best used with _outline_strength of 3 or more. Too small outlines don't get much of the effect.

These pictures show an _outline_strength of 5 -- with and without alpha fading.

No alpha fading Active alpha fading
image image

Draw an object outlined

outliner.draw_object_outline();

This function can take one parameter, the object to draw outlined. If omitted, self is assumed, as this function is normally invoked from the Draw or the Draw GUI events. If you use the outliner outside of an object, you must specify, which object to draw outlined.

Clone this wiki locally