Render
GetFont
Render.GetFont(name, size, is_windows_font);
[EN] Used to add custom font. [RU] ΠΡΠΏΠΎΠ»ΡΠ·ΡΠ΅ΡΡΡ Π΄Π»Ρ Π΄ΠΎΠ±Π°Π²Π»Π΅Π½ΠΈΡ ΡΠΎΠ±ΡΡΠ²Π΅Π½Π½ΠΎΠ³ΠΎ ΡΡΠΈΡΡΠ°.
TextSize
Render.TextSize( text, font )
[EN] Finds the text size of the given string and font. [RU] ΠΠ°Ρ ΠΎΠ΄ΠΈΡ ΡΠ°Π·ΠΌΠ΅Ρ ΡΠ΅ΠΊΡΡΠ° Π΄Π»Ρ Π·Π°Π΄Π°Π½Π½ΠΎΠΉ ΡΡΡΠΎΠΊΠΈ ΠΈ ΡΡΠΈΡΡΠ°.
String
Rendering text now always requires a custom font you make yourself!
function main()
{
var font = Render.GetFont( "Arial.ttf", 15, true)
Render.String(100,200,0, "TEST", [255,0,255,255], font)
}
Cheat.RegisterCallback("Draw", "main")
[EN] Draws a string with the given position, align, RGBA color and font. [RU] Π ΠΈΡΡΠ΅Ρ ΡΡΡΠΎΠΊΡ Ρ Π·Π°Π΄Π°Π½Π½ΡΠΌ ΠΏΠΎΠ»ΠΎΠΆΠ΅Π½ΠΈΠ΅ΠΌ, Π²ΡΡΠ°Π²Π½ΠΈΠ²Π°Π½ΠΈΠ΅ΠΌ, ΡΠ²Π΅ΡΠΎΠΌ RGBA ΠΈ ΡΡΠΈΡΡΠΎΠΌ.
FilledCircle
That all render functions must be called from within "Draw" callback and that rendering only supports ASCII character table.
function drawCircle()
{
Render.FilledCircle( 150, 150, 50, [ 255, 255, 255, 255 ] );
}
Cheat.RegisterCallback("Draw", "drawCircle")
// This function will draw filled circle on screen.
[EN] Draws a filled circle with the given position, radius, and RGBA color. [RU] Π ΠΈΡΡΠ΅Ρ Π·Π°ΠΏΠΎΠ»Π½Π΅Π½Π½ΡΠΉ ΠΊΡΡΠ³ Ρ Π·Π°Π΄Π°Π½Π½ΡΠΌΠΈ ΠΏΠΎΠ»ΠΎΠΆΠ΅Π½ΠΈΠ΅ΠΌ, ΡΠ°Π΄ΠΈΡΡΠΎΠΌ ΠΈ ΡΠ²Π΅ΡΠΎΠΌ RGBA.
TexturedRect
function drawTexture()
{
forumBG = Render.AddTexture("ot/scripts/forumclr.png");
Render.TexturedRect( 300, 300, 100, 100, forumBG );
}
Cheat.RegisterCallback("Draw", "drawTexture");
[EN] Draws a textured rectangle with the given position, size, and texture. [RU] Π ΠΈΡΡΠ΅Ρ ΡΠ΅ΠΊΡΡΡΡΠΈΡΠΎΠ²Π°Π½Π½ΡΠΉ ΠΏΡΡΠΌΠΎΡΠ³ΠΎΠ»ΡΠ½ΠΈΠΊ Ρ Π·Π°Π΄Π°Π½Π½ΡΠΌΠΈ ΠΏΠΎΠ»ΠΎΠΆΠ΅Π½ΠΈΠ΅ΠΌ, ΡΠ°Π·ΠΌΠ΅ΡΠΎΠΌ ΠΈ ΡΠ΅ΠΊΡΡΡΡΠΎΠΉ.
AddTexture
- Path is relative to CSGO folder, so you don't need full path. - Supports the following formats:
.bmp
.dds
.dib
.hdr
.jpg
.pfm
.png
.ppm
.tga
function drawTexture()
{
forumBG = Render.AddTexture("ot/scripts/forumclr.png");
Render.TexturedRect( 300, 300, 100, 100, forumBG );
}
Cheat.RegisterCallback("Draw", "drawTexture");
[EN] Adds a texture. [RU] ΠΠΎΠ±Π°Π²Π»ΡΠ΅Ρ ΡΠ΅ΠΊΡΡΡΡΡ.
Polygon
function drawPolygon()
{
Render.Polygon( [ [ 10.0, 200.0 ], [ 100.0, 10.0 ], [ 200.0, 160.0 ] ], [ 255, 0, 0, 255 ] );
}
Cheat.RegisterCallback("Draw", "drawPolygon");
[EN] Draws a polygon with shape based on arguments passed. [RU] Π ΠΈΡΡΠ΅Ρ ΠΌΠ½ΠΎΠ³ΠΎΡΠ³ΠΎΠ»ΡΠ½ΠΈΠΊ Ρ ΡΠΎΡΠΌΠΎΠΉ Π½Π° ΠΎΡΠ½ΠΎΠ²Π΅ ΠΏΠ΅ΡΠ΅Π΄Π°Π½Π½ΡΡ Π°ΡΠ³ΡΠΌΠ΅Π½ΡΠΎΠ².
GradientRect
Dir argument stands for direction and 0 is vertical while 1 is horizontal
function drawGradient()
{
Render.GradientRect( 100, 100, 100, 100, 0, [ 255, 0, 0, 255 ], [ 255, 255, 255, 255 ]);
Render.GradientRect( 210, 100, 100, 100, 1, [ 255, 0, 0, 255 ], [ 255, 255, 255, 255 ]);
}
Cheat.RegisterCallback("Draw", "drawGradient")
[EN] Draws a gradient rectangle with the given position, size, and RGBA color. [RU] Π ΠΈΡΡΠ΅Ρ ΠΏΡΡΠΌΠΎΡΠ³ΠΎΠ»ΡΠ½ΠΈΠΊ Π³ΡΠ°Π΄ΠΈΠ΅Π½ΡΠ° Ρ Π·Π°Π΄Π°Π½Π½ΡΠΌΠΈ ΠΏΠΎΠ»ΠΎΠΆΠ΅Π½ΠΈΠ΅ΠΌ, ΡΠ°Π·ΠΌΠ΅ΡΠΎΠΌ ΠΈ ΡΠ²Π΅ΡΠΎΠΌ RGBA.
GetScreenSize
function getScreenSize()
{
var screen_size = Render.GetScreenSize();
Cheat.Print( "Width of screen is: " + screen_size[0] + "\n");
Cheat.Print( "Height of screen is: " + screen_size[1] + "\n");
}
Cheat.RegisterCallback("Draw", "getScreenSize")
// This function will print your screen height and width in in-game console.
[EN] Returns width and height of your screen. [RU] ΠΠΎΠ·Π²ΡΠ°ΡΠ°Π΅Ρ ΡΠΈΡΠΈΠ½Ρ ΠΈ Π²ΡΡΠΎΡΡ Π²Π°ΡΠ΅Π³ΠΎ ΡΠΊΡΠ°Π½Π°.
WorldToScreen
The third array object will be 1 if the world position is in front of you, 0 if it is behind you.
Please note that all render functions must be called from within "Draw" callback.
function drawDuckAmount( )
{
players = Entity.GetEnemies( );
for ( i = 0; i < players.length; i++ )
{
if ( Entity.IsAlive( players[i] ) )
{
world = Entity.GetRenderOrigin( players[i] );
screen_bot = Render.WorldToScreen( world );
duckamount = Entity.GetProp( players[i], "DT_BasePlayer", "m_flDuckAmount" );
world_top = world;
world_top[2] = world_top[2] + ( 64 * ( 1 - duckamount ) );
screen_top = Render.WorldToScreen( world_top );
if ( screen_bot[2] == 1 && screen_top[2] == 1 )
{
Render.Line( screen_bot[0], screen_bot[1], screen_top[0], screen_top[1], [ 0, 0, 255, 255 ] );
}
}
}
}
Cheat.RegisterCallback("Draw", "drawDuckAmount");
// This script will draw a line on enemy players which represents their duck amount.
[EN] Finds the world position for the given screen position. [RU] ΠΠ°Ρ ΠΎΠ΄ΠΈΡ ΠΌΠΈΡΠΎΠ²ΡΡ ΠΏΠΎΠ·ΠΈΡΠΈΡ Π΄Π»Ρ Π΄Π°Π½Π½ΠΎΠΉ ΠΏΠΎΠ·ΠΈΡΠΈΠΈ Π½Π° ΡΠΊΡΠ°Π½Π΅.
Circle
Please note that all render functions must be called from within "Draw" callback and that rendering only supports ASCII character table.
function drawCircle()
{
Render.Circle( 150, 150, 50, [ 255, 255, 255, 255 ] );
}
Cheat.RegisterCallback("Draw", "drawCircle")
// This function will draw a circle on screen.
[EN] Draws a circle with the given position, radius, and RGBA color. [RU] Π ΠΈΡΡΠ΅Ρ ΠΊΡΡΠ³ Ρ Π·Π°Π΄Π°Π½Π½ΡΠΌΠΈ ΠΏΠΎΠ»ΠΎΠΆΠ΅Π½ΠΈΠ΅ΠΌ, ΡΠ°Π΄ΠΈΡΡΠΎΠΌ ΠΈ ΡΠ²Π΅ΡΠΎΠΌ RGBA.
FilledRect
Please note that all render functions must be called from within "Draw" callback and that rendering only supports ASCII character table.
function drawFilledRect()
{
Render.FilledRect( 100, 100, 150, 150, [ 255, 0, 0, 180 ] );
}
Cheat.RegisterCallback("Draw", "drawFilledRect")
// This function will draw a filled rectangle on screen.
[EN] Draws a filled rectangle with the given position, size, and RGBA color. [RU] Π ΠΈΡΡΠ΅Ρ Π·Π°ΠΏΠΎΠ»Π½Π΅Π½Π½ΡΠΉ ΠΏΡΡΠΌΠΎΡΠ³ΠΎΠ»ΡΠ½ΠΈΠΊ Ρ Π·Π°Π΄Π°Π½Π½ΡΠΌΠΈ ΠΏΠΎΠ»ΠΎΠΆΠ΅Π½ΠΈΠ΅ΠΌ, ΡΠ°Π·ΠΌΠ΅ΡΠΎΠΌ ΠΈ ΡΠ²Π΅ΡΠΎΠΌ RGBA.
Rect
Please note that all render functions must be called from within "Draw" callback and that rendering only supports ASCII character table.
function drawRect()
{
Render.Rect( 100, 100, 150, 150, [ 255, 0, 0, 255 ] );
}
Cheat.RegisterCallback("Draw", "drawRect")
// This function will draw a rectangle on screen.
[EN] Draws a rectangle with the given position, size, and RGBA color. [RU] Π ΠΈΡΡΠ΅Ρ ΠΏΡΡΠΌΠΎΡΠ³ΠΎΠ»ΡΠ½ΠΈΠΊ Ρ Π·Π°Π΄Π°Π½Π½ΡΠΌΠΈ ΠΏΠΎΠ»ΠΎΠΆΠ΅Π½ΠΈΠ΅ΠΌ, ΡΠ°Π·ΠΌΠ΅ΡΠΎΠΌ ΠΈ ΡΠ²Π΅ΡΠΎΠΌ RGBA.
Line
Please note that all render functions must be called from within "Draw" callback and that rendering only supports ASCII character table.
function drawLine()
{
Render.Line( 100, 200, 300, 200, [ 255, 0, 0, 255 ] );
}
Cheat.RegisterCallback("Draw", "drawLine")
// This function will draw a line on your screen.
[EN] Draws a line with the given position RGBA color. [RU] Π ΠΈΡΡΠ΅Ρ Π»ΠΈΠ½ΠΈΡ Ρ Π·Π°Π΄Π°Π½Π½ΡΠΌ ΡΠ²Π΅ΡΠΎΠΌ RGBA ΠΏΠΎΠ·ΠΈΡΠΈΠΈ.
Last updated
Was this helpful?