💻
pasteware
  • Introduction
  • Namespaces
    • engine_client
    • global_vars
    • renderer
    • config
    • math
    • input
    • cheat
  • Hooks
    • CreateMove
    • PaintTraverse
    • FrameStageNotify
  • Types
    • CUserCmd
    • ang_t
    • vec3_t
    • vec2_t
    • color_t
Powered by GitBook
On this page
  • get_screen_size(): vec2_t
  • create_font( identifier, font_name, size, weight, flags )
  • text( font, x, y, text, flags, color )
  • get_text_size( font, text ): vec2_t
  • line( x0, y0, x1, y1, color )
  • rect( x, y, w, y, color )
  • rect_filled( x, y, w, h, color )
  • rect_filled_fade( x, y, w, h, color, a0, a1 )
  • rect_filled_gradient( x, y, w, h, color0, color1 )
  • circle( x, y, radius, segments, color )
  • circle_filled( x, y, radius, segments, color )

Was this helpful?

  1. Namespaces

renderer

get_screen_size(): vec2_t

Returns the width and height of the game's window

var screen_size = renderer.get_screen_size();

create_font( identifier, font_name, size, weight, flags )

Creates a new font object

Type

Name

Description

string

identifier

A unique identifier for your font

string

font_name

The font's name

int

size

The font's size

int

weight

The font's weight

int

flags

The font's flags

var example_font = renderer.create_font( "my_awesome_font", "Tahoma", 12, 0, font_flags.FONTFLAG_NONE );

text( font, x, y, text, flags, color )

Draws a string at the two given points

Type

Name

Description

object

font

The font you want the text to be drawn in

int

x

The position on the x axis

int

y

The position on the y axis

string

text

The text you want to draw

int

flags

The alignment flags you want to use

color_t

color

The color you want the text to be

renderer.text( example_font, 100, 100, "Hello, world!", align_flags.ALIGN_LEFT, new color_t( 255, 255, 255, 255 ) );

get_text_size( font, text ): vec2_t

Returns the width and height of the given string

Type

Name

Description

object

font

The font you want the text to eventually be drawn in

string

text

The text you want to check the size of

var text_size = renderer.get_text_size( example_font, "Hello, world!" );

line( x0, y0, x1, y1, color )

Draws a line in the given color between the two given points.

Type

Name

Description

float

x0

Starting position on the x axis

float

y0

Starting position on the y axis

float

x1

Ending position on the x axis

float

y1

Ending position on the y axis

color_t

color

The color you want the line to be

renderer.line( 100, 100, 200, 200, new color_t( 255, 255, 255, 255 ) );

rect( x, y, w, y, color )

Draws a rectangle (not filled) between the two given points.

Type

Name

Description

float

x

Starting position on the x axis

float

y

Starting position on the y axis

float

w

How wide the rectangle should be

float

h

How tall the rectangle should be

color_t

color

The color you want the rectangle to be

renderer.rect( 100, 100, 200, 200, new color_t( 255, 255, 255, 255 ) );

rect_filled( x, y, w, h, color )

Draws a rectangle (filled) between the two given points.

Type

Name

Description

float

x

Starting position on the x axis

float

y

Starting position on the y axis

float

w

How wide the rectangle should be

float

h

How tall the rectangle should be

color_t

color

The color you want the rectangle to be

renderer.rect_filled( 100, 100, 200, 200, new color_t( 255, 255, 255, 255 ) );

rect_filled_fade( x, y, w, h, color, a0, a1 )

Draws a rectangle (filled) between the two given points that fades from the first alpha, to the second.

Type

Name

Description

float

x

Starting position on the x axis

float

y

Starting position on the y axis

float

w

How wide the rectangle should be

float

h

How tall the rectangle should be

color_t

color

The color you want the rectangle to be

float

a0

The starting alpha

float

a1

The ending alpha

renderer.rect_filled_fade( 100, 100, 200, 200, new color_t( 255, 255, 255, 255 ), 255, 155 );

rect_filled_gradient( x, y, w, h, color0, color1 )

Draws a rectangle (filled) between the two given points that fades from the first color to the second.

Type

Name

float

x

Starting position on the x axis

float

y

Starting position on the y axis

float

w

How wide the rectangle should be

float

h

How tall the rectangle should be

color_t

color0

The starting color

color_t

color1

The ending color

renderer.rect_filled_gradient( 100, 100, 200, 200, new color_t( 0, 255, 0, 255 ), new color_t( 255, 0, 0, 255 ) );

circle( x, y, radius, segments, color )

Draws a circle (not filled) at the two given points.

Type

Name

Description

float

x

The position on the x axis

float

y

The position on the y axis

int

radius

How big the circle should be

int

segments

How many segments should be used to the create the circle

color_t

color

The color you want the circle to be

renderer.circle( 100, 100, 25, 32, new color_t( 255, 255, 255, 255 ) );

circle_filled( x, y, radius, segments, color )

Draws a circle (filled) at the two given points

Type

Name

Description

float

x

The position on the x axis

float

y

The position on the y axis

int

radius

How big the circle should be

int

segments

How many segments should be used to the create the circle

color_t

color

The color you want the circle to be

Previousglobal_varsNextconfig

Last updated 4 years ago

Was this helpful?