SetDrawColor: Difference between revisions
From Onset Developer Wiki
No edit summary |
No edit summary |
||
Line 11: | Line 11: | ||
== 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}} |
Revision as of 12:44, 24 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")