SetDrawColor: Difference between revisions
From Onset Developer Wiki
Created page with "{{Info|Function|Client|1.0}} {{FuncDescription|__EDIT_ME__}} {{FuncSyntax|SetDrawColor(HexColor)}} {{FuncParameters}} {{FuncParam|HexColor|__EDIT_ME__}} {{FuncReturnValue|..." |
No edit summary |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{Info|Function|Client|1.0}} | {{Info|Function|Client|1.0}} | ||
{{FuncDescription| | {{FuncDescription|Sets the color that will be used by all Draw* functions.}} | ||
{{FuncSyntax|SetDrawColor( | {{FuncSyntax|SetDrawColor(IntColor)}} | ||
{{FuncParameters}} | {{FuncParameters}} | ||
{{FuncParam| | {{FuncParam|IntColor|Color as an integer from [[RGBA]].}} | ||
{{FuncReturnValue| | {{FuncReturnValue|Returns ''true''.}} | ||
== Example == | == Example == | ||
<syntaxhighlight lang="Lua"> | |||
local x, y, z = GetPlayerLocation() | |||
local ScreenX, ScreenY = GetScreenSize() | |||
SetDrawColor(RGB(255, 255, 255)) -- White color | |||
DrawText(2, ScreenY - 40, tostring("Player location: "..x..", "..y..", "..z)) | |||
SetDrawColor(RGB(255, 0, 0)) -- Red color | |||
DrawText(2, ScreenY - 55, "Some other text") | |||
</syntaxhighlight> | |||
{{RelatedFunctions}} | {{RelatedFunctions}} | ||
* [[DrawText]] | |||
* [[SetDrawColor]] | |||
* [[SetTextDrawScale]] | |||
* [[GetTextSize]] | |||
* [[DrawLine]] | |||
* [[DrawLine3D]] | |||
* [[DrawPoint3D]] | |||
* [[DrawCircle3D]] | |||
* [[DrawBox]] | |||
* [[DrawRect]] | |||
* [[DrawTexture]] | |||
* [[DrawTextureEx]] | |||
* [[DrawMaterial]] |
Latest revision as of 20:25, 30 August 2020
Description
Sets the color that will be used by all Draw* functions.
Syntax
SetDrawColor(IntColor)
Parameters
- IntColor
Color as an integer from RGBA.
Return Value
- Returns true.
Example
local x, y, z = GetPlayerLocation()
local ScreenX, ScreenY = GetScreenSize()
SetDrawColor(RGB(255, 255, 255)) -- White color
DrawText(2, ScreenY - 40, tostring("Player location: "..x..", "..y..", "..z))
SetDrawColor(RGB(255, 0, 0)) -- Red color
DrawText(2, ScreenY - 55, "Some other text")