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?