Skip to main content
Your plugin draws over the game from a draw handler, and shows short notices with reskate.ui.toast. Both need the overlay permission. What plugins draw sits under ReSkate’s own menus and chat, takes no input, and shows only on this player’s screen. A plugin’s server copy draws nothing.

The draw handler

ReSkate calls your draw handlers once a game tick with a drawing object, d, and keeps what they drew until the next tick; the overlay shows the latest drawing every frame. Draw everything you want shown each time: nothing carries over from one call to the next. d’s functions are called with a colon (d:text(...)). The shape functions work only while a draw handler runs: calling one at any other time (from a timer, with a d you kept) raises an error.

Flashing

Fast flashing over a large part of the screen can bring on seizures, so the overlay holds back how fast a plugin’s drawing can brighten the screen. It adds up the light of each filled shape (rectangles, pictures, gradients, tiles and filled polygons): its colour’s brightness times its opacity, times the share of the screen it covers. That total may rise by at most 1.5 of a whole white screen a second, and fall as fast as you like. When your drawing would be brighter than that, its filled shapes are drawn more transparent until it catches up. So a full-screen white flash shown eight times a second comes out at about a tenth of its strength, and a bright full-screen picture fades in over about two thirds of a second. A HUD, text and shapes over a small part of the screen are never held back. While a plugin’s drawing covers most of the screen, the game names the plugin in the bottom corner and says that Ctrl+Shift+End switches plugins off.

Coordinates

  • Screen shapes take positions as vectors in pixels of the game window, from its top left: vector.create(x, y, 0) (the z is ignored). d:size() gives the window’s width and height.
  • World shapes (world_*) take positions in world metres. They are projected through the game’s camera as each frame is drawn, and a shape behind the camera is left out. Their sizes on screen (text size, line thickness) stay the same whatever the distance, except world_circle’s radius and world_image’s height, which are in metres.
  • Sizes in the style (text size, thickness, rounding) are pixels at 1080 lines: they scale with the window’s height, so a size of 18 is 18 pixels at 1080p and 36 at 2160p.
Every position must be finite and within a million units of the origin, or the call raises an error.

The style table

Most functions take a last, optional style table. Every field is optional. A size, thickness or rounding out of its range is brought into it. A colour in another form, an align or font that is not one of its names, a uv corner outside 0 to 1, or a number that is not finite raises an error.

Screen shapes

d:text(position, text, style)

Text at a point. The point is its top left, top centre or top right, as align says.
vector
required
Pixels from the window’s top left.
string
required
At most 500 characters.
table
colour, size, align, shadow, font.

d:rect(top_left, bottom_right, style)

A rectangle, outlined or filled.
vector
required
One corner, in pixels.
vector
required
The opposite corner, in pixels.
table
colour, fill, thickness, rounding.

d:line(from, to, style)

A straight line.
vector
required
Pixels.
vector
required
Pixels.
table
colour, thickness.

d:circle(centre, radius, style)

A circle, outlined or filled.
vector
required
Pixels.
number
required
0 or more, in pixels of the window (it does not scale with the window’s height).
table
colour, fill, thickness.

d:poly(points, style)

A closed polygon through 3 to 64 points. A filled polygon must be convex to fill as you expect.
table
required
A list of 3 to 64 vectors, in pixels.
table
colour, fill, thickness.

d:gradient(top_left, bottom_right, colours)

A filled rectangle that shades between the colours of its four corners.
vector
required
One corner, in pixels.
vector
required
The opposite corner, in pixels.
table
required
A list of four colours, each in a form the style’s colour takes: the top left’s, the top right’s, the bottom right’s and the bottom left’s.
A list of fewer than four colours raises an error. A gradient takes no style: it has no rounding or outline.

d:image(path, top_left, bottom_right, style)

A picture from your package, stretched to the rectangle.
string
required
A .png or .jpg (.jpeg) file in your package, at most 200 characters. See package paths.
vector
required
Pixels.
vector
required
Pixels.
table
colour tints it (white draws it as it is), rounding rounds its corners, uv picks part of it.
A picture is loaded the first time you draw it, and shows a few frames later. A picture file is at most 2 MB and 512 x 512 pixels; one larger, or one that is not a PNG or JPG inside, is not drawn, and a warning is logged. The overlay holds at most 32 pictures at once for all plugins together: a picture not drawn for 2 seconds makes room for a new one, and a new one finds no room while 32 others are being drawn.

d:game_image(name, top_left, bottom_right, style)

One of skate.’s own pictures, by name: its scoring icons, the THRASHER wordmark, the brush strokes and tiles its menus are built from, and its customization menu’s category icons. ReSkate reads them from the installed game, so your package ships none of them.
string
required
One of the 31 names below. Any other name raises an error that lists them.
vector
required
Pixels.
vector
required
Pixels.
table
colour tints it: the pictures are white or grey, so the colour you give is the colour they show (loading_board keeps its own colours, and colour fades it). fit and edge (below) say how it goes onto the box; frame picks a flipbook’s picture. rounding and uv do nothing here.
edge is 0 to 400, in pixels at 1080 lines (default 0). A fit that is not one of the three raises an error. frame is for loading_board only, a flipbook of 27 pictures shown at 30 a second: a whole number from 0 to 26 (default 0), fitted into the box. A frame on another picture, or out of range, raises an error. The scoring icons and the stopwatch are about 64 pixels in the game, so they look best drawn small; the others are larger.
The pictures are read once, a moment after the game starts; until then, or when the game’s files cannot be read, nothing is drawn. They do not count towards the 32 pictures a plugin may draw from its package.

World shapes

d:world_text(position, text, style)

Text at a place in the world.
vector
required
World metres.
string
required
At most 500 characters.
table
colour, size, align, shadow, font.

d:world_line(from, to, style)

A line between two places in the world. It is left out when either end is behind the camera.
vector
required
World metres.
vector
required
World metres.
table
colour, thickness.

d:world_circle(centre, radius, style)

A circle around a place in the world, with a radius of radius metres at that distance: it grows as the camera comes closer. It always faces the camera: it is a ring on the screen, not one lying on the ground.
vector
required
World metres.
number
required
0 or more, in metres.
table
colour, fill, thickness.

d:world_image(path, position, height, style)

A picture standing at a place in the world, centred on it, height metres tall; its width follows the picture’s shape.
string
required
A .png or .jpg file in your package.
vector
required
Its centre, in world metres.
number
required
More than 0 and at most 1000 metres.
table
colour tints it, uv picks part of it.

The skater’s x-ray

d:skeleton(paint, alpha)

The local skater’s skeleton, seen through the skater: skate.’s own skeleton, posed as the game last drew the skater, from the camera of that picture. Each body part you paint shows in its colour, shaded by the way it faces the camera; the parts you leave out are not drawn. Call reskate.skater.xray(true) first: without it, before its skeleton is read, or without a skater, nothing is drawn.
table
required
Colours by body part, such as {Head = "#ff4040"}. The names are those of the body_hit event, plus Left toes, Left foot, Right toes and Right foot. An empty table draws nothing.
number
default:"1"
0 to 1: fades the whole skeleton.
A key that is not a body part’s name, a colour in another form, or an alpha out of range raises an error. The skeleton counts as one shape.

skate.’s drawn details

The touches skate.’s menus are drawn with, as the ReSkate menus draw them: no picture files.

d:rough_rect(top_left, bottom_right, style)

A filled tile with skate.’s slightly rough, hand-cut edges.
vector
required
Pixels.
vector
required
Pixels.
table
colour; seed, a whole number from 0 that picks its edge (the same seed, the same edge, so it does not shimmer; default 1); and scale, how rough, 0.1 to 10 (default 1, at 1080 lines).

d:halftone(top_left, columns, rows, style)

A screen-print of small dots, 7 pixels apart, every other row offset: the spray skate. puts in a tile’s corner.
vector
required
Pixels.
integer
required
1 to 64.
integer
required
1 to 64.
table
colour.

d:scribble(top_left, bottom_right, style)

The dry-brush scribble skate. draws over a tile: three dark strokes across the box.
vector
required
Pixels.
vector
required
Pixels.
table
seed and scale, as rough_rect takes them.

d:clip(top_left, bottom_right)

What the handler draws after it shows only inside the box, as in a list that scrolls. d:clip() with nothing ends the last one; clips nest, up to 16, and every one still open ends with the frame.
vector
Pixels. Leave both out to end a clip.
vector
Pixels.

Measuring

d:measure(text, style)

How wide and tall a text is drawn, for laying out boxes and columns.
string
required
At most 500 characters.
table
size, font and wrap, as d:text takes them.
vector
x its width and y its height, in the window’s pixels (the size scaled to the window, as it is drawn); z is 0. A wrapped text is as tall as its lines.
Before the overlay has drawn its first frame its fonts are not known, and the size is a guess.

d:size()

The game window’s size.
vector
x its width and y its height, in pixels; z is 0.

d:world_to_screen(position)

Where a place in the world is on the screen now.
vector
required
World metres.
vector or nil
x and y in pixels from the window’s top left, and z its depth in front of the camera; nil when it is behind the camera, or so close to it and so far to the side that it lands more than a million pixels out, where the drawing functions would refuse it. Whatever comes back can be drawn.

Limits

Needs overlay, for the draw event and every d function. In one tick a plugin draws at most 4000 shapes and 64 KB of text; the rest are left out, and a warning is logged at most once every 10 s, saying which of the two limits was hit. A plugin draws at most 32 different pictures from its package in all its life (each path counts once; the game’s own pictures do not count); the next raises an error. A wrong argument raises an error: a position that is not a vector, text over 500 characters, a negative radius, a polygon of fewer than 3 or more than 64 points, a picture that is not a .png or .jpg file in the package, a game picture’s name that is not one of the 14, a gradient without four colours, a halftone outside 1 to 64 dots each way, a seed that is not a whole number from 0.

Screen look

A camcorder look over the game’s whole picture, for a filming mode: a fisheye adapter’s bend and its hood’s dark edge, 4:3 bars, the camcorder’s colour, standard-definition softness, interlaced fields, tape grain and its faults, an auto-iris, a hand that slaps the lens, and burnt-in text in the camcorder’s own blocky characters. It is drawn under everything the overlay draws, plugins’ shapes and ReSkate’s menus included, and shows only on this player’s screen.

reskate.screen.look(look)

table or nil
required
The look. Every effect is off unless you turn it on. nil ends your look.
boolean
True when your look is on the screen (or ended).
string
"<plugin> has the screen's look" when another plugin set its look in the last 300 ms.
Needs the overlay permission. A look lasts 300 ms: call it every tick to keep it on. One plugin’s look is on the screen at a time; nil from another plugin does nothing. A bend or age outside 0 to 1, a fov outside 5 to 170, a negative rolling, more than 5 lines of text, a line over 12 characters or with a character the camcorder cannot show raises an error. The colour grade and the grain are left out when the game draws in HDR, and the auto-iris in HDR10. On a system that cannot build the look, it is not drawn and the log says why, once; look still returns true. When the plugin stops, its look ends.

reskate.screen.slap()

A hand slaps the lens: it reaches round from a lower corner, presses on the glass a moment and pulls away, about 0.6 s in all, from the other side every second time. The iris closes down as it covers the lens and opens too wide for a moment as it comes off.
boolean
True when the hand slaps, or one is already slapping.
string
"only over this plugin's screen look" unless your plugin’s look is on the screen.
Needs the overlay permission.

Toasts

reskate.ui.toast(message, level)

Shows a short notice in ReSkate’s notices, top left, titled with your plugin’s folder name.
string
required
At most 200 characters.
string
default:"\"info\""
"info", "warn" or "error".
boolean
true when it is shown; false when the plugin showed 3 toasts in the last 5 seconds.
Needs overlay. At most 3 toasts in 5 seconds; past them it returns false. Raises an error for a message over 200 characters or another level.