Draw XXL documentation


Draw Basics.RayColorFade(...);

Draws a ray simliar to Ray(), but additionally it can have a color fade from start to end.

Green parameters are required. Yellow parameters are optional, but have to be supplied in order.


static void DrawBasics.RayColorFade(...);

Code snippet names: drawRayColFade and drawRayColFade_func.
Parameters:
Image Type Parameter Name Description
Vector3 start The start position of the ray
Vector3 direction The ray that gets drawn, mounted at the start position.
Color startColor The color of the ray at the start position.
Color endColor The color of the ray at the end position.
float width The line width in worldspace of the ray. The default value of 0 means that that the ray will have a width of one pixel.
string text An optional text to display along the ray. See AutomaticAmplitudeAndTextAlignment, AutomaticTextDirectionOfLines and CameraForAutomaticOrientation for more information how the text will get displayed.
LineStyle style A style for the ray. The default is called "solid", which is a straight line, but it can also be dotted, dashed, zigzag, sine, freehand, ...
float stylePatternScaleFactor If the style parameter has been set to custom style (meaning not the default solid style) then this parameter scales the line pattern. It can help to adjust the line appearance so it fits different orders of view magnitude. A zigzag pattern may be well recognizable when the observing camera is looking up close, but may be too small when zooming out and looking at the scene from a far away overview position. This parameter can help mitigating such observer changes.
float animationSpeed If the style parameter has been set to custom style (meaning not the default solid style) then it can be animated and appears as if the pattern walks along the line. Note that seamlessly changing the animation speed to get an effect of an accelerating or decelerating animation is not possible inside a static draw function like the here documented "DrawBasics.Line". You can still get this effect when using a line object instead, which can keep track of the acceleration.
Vector3 customAmplitudeAndTextDir As soon as custom line styles like zigzag (whose amplitudes protrude sideways from the actual line stretch) come into play there is the question to which side the protrusion should go. The same question applies to a tag text who stands vertical along the line. The default behaviour is that a global setting takes care of it, but for custom cases it can be explicitly set by this parameter.
bool flattenThickRoundLineIntoAmplitudePlane This only applies for lines whose width is bigger than the default value of 0. Such lines can either be "real round" in worldspace, or be made flat into the amplitude plane (see description of the preceding "customAmplitudeAndTextDir" parameter)
float endPlates_size The ray can optinally have end position markers which are called "end plates" here. The styling of the end plates depends on the aforementioned "flattenThickRoundLineIntoAmplitudePlane" parameter. The size that is specified here is interpreted as relative to the line lenght or in absolute units according to the global end plates size interpretation setting. The global settings DrawBasics.disableEndPlates_atLineStart and DrawBasics.disableEndPlates_atLineEnd can be used to draw the plate only at one specific line end and leave the other end without plate.
float alphaFadeOutLength_0to1 With this parameter an effect can be created where the ray does not end distincly at the line end position, but slowly fades out towards the ray end position. The default value of 0 means that the effect is disabled.
float enlargeSmallTextToThisMinTextSize This only has effect if the "text" parameter is used. The normal behaviour of text is that it scales with the line lenght. Though depending on the situation the line may get very small, up until the text is not readable anymore. This parameter sets a limit for the minimum text size. The text carrying line may get shorter and shorter but the text can stay visible.
float durationInSec The duration in seconds how long the drawn thing stays visible. The default value of 0 means that it stays only during the current Update frame. Instead of using this parameter you can also overwrite him with a global setting so you don't always have to supply all other preceding function parameters till you reach this late parameter.
bool hiddenByNearerObjects This specifies if the drawn thing will get hidden if other geometry is in front of it or if it shines through. It is the same as the depthTest parameter of Unitys Debug.DrawLine(). Not all drawing methods support toggling this in the same way. For some methods the lines are fully hidden, for others the hidden lines shimmer through. Instead of using this parameter you can also overwrite him with a global setting so you don't always have to supply all other preceding function parameters till you reach this late parameter.
bool skipPatternEnlargementForLongLines This is only for very special cases: It has to do with line styles and the "stylePatternScaleFactor" parameter. Since the styled lines of Draw XXL are made up of single small straigh lines it potentially uses many of those small straight lines which can negatively affect the Editor performance. Imagine a very long line with small zigzag pattern. This creates potentially many straight lines. Draw XXL lines therefore by default enlarges the pattern if the styled lines become very long. You can skip the auto-enlargement behaviour with the "skipPatternEnlargementForLongLines" bool here.
bool skipPatternEnlargementForShortLines This is only for very special cases: It has to do with line styles and the "stylePatternScaleFactor" parameter and is related to the "skipPatternEnlargementForLongLines" parameter but for short lines. It mostly affects only lines whose width is bigger than 0. For short thick dashed lines Draw XXL enlarges the dash pattern so it stays recognizable. This behaviour can be skipped via the "skipPatternEnlargementForShortLines" parameter here.