natives.setTextEdge: Difference between revisions
Jump to navigation
Jump to search
ChrisGame20 (talk | contribs) (Created page with "{{ScriptItem |endpoint = client |games = iv |type = function |name = natives.setTextEdge |parameters = bool enable, int r, int g, int b, int a |parameter1 = bool enable True to enable edge effect, false to disable |parameter2 = int r Red component of the edge colour (0–255) |parameter3 = int g Green component of the edge colour (0–255) |parameter4 = int b Blue component of the edge colour (0–255) |parameter5 = int a Alpha component (opacity) of the edge colour (0...") |
(No difference)
|
Latest revision as of 16:53, 28 November 2025
Function Client Only ![]()
Online and Offline
Available since Client 1.0.0
void natives.setTextEdge(bool enable, int r, int g, int b, int a)
The natives.setTextEdge function is used to Enables or disables a coloured edge (outline) around text drawn on the screen.
Parameters
| 1) | bool | enable | True to enable edge effect, false to disable. |
| 2) | int | r | Red component of the edge colour (0–255). |
| 3) | int | g | Green component of the edge colour (0–255). |
| 4) | int | b | Blue component of the edge colour (0–255). |
| 5) | int | a | Alpha component (opacity) of the edge colour (0–255). |
Return
| void | This function doesn't return a value. |
Notes
- - Must be called before natives.displayTextWithLiteralString or similar text drawing functions- The edge effect is essentially an outline that improves readability against backgrounds- Alpha controls the opacity of the edge; 255 = fully visible, 0 = invisible- Combine with natives.setTextDropshadow for stronger contrast.
Examples
Example 1 - JavaScript:
addEventHandler("OnDrawnHUD", function() {
// White text with a black edge outline natives.setTextScale(0.30, 0.30); natives.setTextFont(0); natives.setTextColour(255, 255, 255, 255); natives.setTextEdge(true, 0, 0, 0, 255);
natives.displayTextWithLiteralString(new Vec2(0.05, 0.10), "STRING", "Text with black border");
});
Compatibility
There isn't any compatibility information for this function.