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?