ColorInfo
Renderer.ColorInfo struct. Used by fancy shader drawings.
note
Part of Renderer namespace.
Properties
from
: number - D3DCOLOR
Main color
to
: number - D3DCOLOR
Secondary color (Used in gradient)
gradientType
: GradientType
Gradient type.
Functions
new
ColorInfo.new(colFrom: number, colTo: number, gradType: GradientType)
→ ColorInfo
Argument | Type | Description |
---|---|---|
colFrom | number - D3DCOLOR | Main color |
colTo | number - D3DCOLOR | Secondary color (Used in gradient) |
gradType | GradientType | Gradient type. |
ColorInfo constructor
new
ColorInfo.new(colFrom: number, colTo: number)
→ ColorInfo
Argument | Type | Description |
---|---|---|
colFrom | number - D3DCOLOR | Main color |
colTo | number - D3DCOLOR | Secondary color (Used in gradient) |
ColorInfo constructor
new
ColorInfo.new(col: number)
→ ColorInfo
Argument | Type | Description |
---|---|---|
col | number - D3DCOLOR | Main color |
ColorInfo constructor
Examples
Draw fancy shader circle around selected target.
local MyGlowingCircleHash = Game.fnvhash("Example_MyGlowingCircle") -- This must be unique hash per drawing. Use unique prefix.
local color = Renderer.ColorInfo.new(0xFFFFFFFF, 0xFF5555FF, Renderer.GradientType.Linear)
local radius = 100
Callback.Bind(CallbackType.OnDraw, function()
local tar = Game.GetSelectedTarget()
if tar and tar:IsValid() then
Renderer.DrawEffectCircle(MyGlowingCircleHash, tar.position2D, radius, color, Renderer.EffectType.MagicalCircle)
end
end)