Jik

  • Template: cart_jik - press "Use this template" and you have a working game.
  • Docker image: ghcr.io/notnullgames/null0-cart-jik:latest (linux/amd64 only - runs emulated on Apple Silicon)
  • Your code: cart/main.jik, compiled with jik (transpiles to C) + wasi-sdk
  • Bindings: carts/jik/null0.jik (a reference list to copy from)
  • WASI is available, so ordinary file and stdio calls work.

building

You do not install jik (transpiles to C) + wasi-sdk - the docker image has it, and the current null0 bindings, baked in. That is the whole point: there is nothing in your project to keep in sync with the engine.

docker run --rm --user $(id -u):$(id -g) --platform linux/amd64 \
  -v ./cart:/src -v ./webroot:/out \
  ghcr.io/notnullgames/null0-cart-jik:latest mygame

The template wraps that in npm start, which also serves the result and rebuilds when you save.

Jik notes

  • Jik's types don't line up with the null0 ABI, so null0.jik is a set of extern declarations and C wrappers to copy into your cart's @embed block.

a cart, in Jik

This is carts/jik/simple/main.jik in the engine repo - the same file CI builds into the cart below, so it always compiles.

// null0 Jik example: color bars
//
// NOTE: Jik does not have u8, f32, or uint types, so we use C wrappers
// in the @embed block to bridge the gap.

@embed{C_END}
#include "null0.h"

// C wrappers to bridge Jik's type system to null0's ABI
static void jik_clear(int r, int g, int b, int a) {
    Color c = { (unsigned char)r, (unsigned char)g, (unsigned char)b, (unsigned char)a };
    clear(c);
}
static void jik_draw_rect(int x, int y, int w, int h, int r, int g, int b, int a) {
    Color c = { (unsigned char)r, (unsigned char)g, (unsigned char)b, (unsigned char)a };
    draw_rectangle(x, y, w, h, c);
}
static void jik_draw_rect_outline(int x, int y, int w, int h, int t, int r, int g, int b, int a) {
    Color c = { (unsigned char)r, (unsigned char)g, (unsigned char)b, (unsigned char)a };
    draw_rectangle_outline(x, y, w, h, t, c);
}
static void jik_draw_circ(int cx, int cy, int rad, int r, int g, int b, int a) {
    Color c = { (unsigned char)r, (unsigned char)g, (unsigned char)b, (unsigned char)a };
    draw_circle(cx, cy, rad, c);
}


C_END

// Jik extern declarations for the C wrappers
extern func jik_clear as clear(r: int, g: int, b: int, a: int) -> void
extern func jik_draw_rect as draw_rect(x: int, y: int, w: int, h: int, r: int, g: int, b: int, a: int) -> void
extern func jik_draw_rect_outline as draw_rect_outline(x: int, y: int, w: int, h: int, t: int, r: int, g: int, b: int, a: int) -> void
extern func jik_draw_circ as draw_circle(cx: int, cy: int, rad: int, r: int, g: int, b: int, a: int) -> void

func rect(x: int, w: int, r: int, g: int, b: int):
    draw_rect(x, 10, w, 460, r, g, b, 255)
    draw_rect_outline(x, 10, w, 460, 1, 255, 255, 255, 255)
end

func load():
    w := (640 - 11 * 10) / 10

    // circles for visual interest
    draw_circle(320, 240, 150, 255, 255, 255, 255)
    draw_circle(320, 240, 100, 230, 41, 55, 255)
    draw_circle(320, 240, 50, 0, 0, 0, 255)

    // colored bars
    rect(10, w, 230, 41, 55)
    rect(10 + (w + 10) * 1, w, 255, 161, 0)
    rect(10 + (w + 10) * 2, w, 253, 249, 0)
    rect(10 + (w + 10) * 3, w, 0, 228, 48)
    rect(10 + (w + 10) * 4, w, 0, 121, 241)
    rect(10 + (w + 10) * 5, w, 200, 122, 255)
    rect(10 + (w + 10) * 6, w, 255, 109, 194)
    rect(10 + (w + 10) * 7, w, 102, 191, 255)
    rect(10 + (w + 10) * 8, w, 0, 158, 47)
    rect(10 + (w + 10) * 9, w, 255, 0, 255)
end

func update():
end

func main():
end
carts/jik/simple/main.jik

callbacks

A cart implements the callbacks it cares about. In Jik they look like this:

export func update() -> void

See anatomy of a cart for the full list and what each one is passed.

more Jik carts

the API, in Jik

Every null0 function, spelled the way Jik spells it. These are read out of the generated bindings themselves, so they match what your editor completes.

colors (7)

Tint a color with another color.

extern func color_tint as color_tint(color: int, tint: int) -> int

Fade a color.

extern func color_fade as color_fade(color: int, alpha: double) -> int

Change the brightness of a color.

extern func color_brightness as color_brightness(color: int, factor: double) -> int

Invert a color.

extern func color_invert as color_invert(color: int) -> int

Blend 2 colors together.

extern func color_alpha_blend as color_alpha_blend(dst: int, src: int) -> int

Change contrast of a color.

extern func color_contrast as color_contrast(color: int, contrast: double) -> int

Interpolate colors.

extern func color_bilinear_interpolate as color_bilinear_interpolate(color00: int, color01: int, color10: int, color11: int, coordinateX: double, coordinateY: double) -> int
graphics (75)

Create a new blank image.

extern func new_image as new_image(width: int, height: int, color: int) -> Image

Copy an image to a new image.

extern func image_copy as image_copy(image: Image) -> Image

Create an image from a region of another image.

extern func image_subimage as image_subimage(image: Image, x: int, y: int, width: int, height: int) -> Image

Clear the screen.

extern func clear as clear(color: int) -> void

Draw a single pixel on the screen.

extern func draw_point as draw_point(x: int, y: int, color: int) -> void

Draw a line on the screen.

extern func draw_line as draw_line(startPosX: int, startPosY: int, endPosX: int, endPosY: int, color: int) -> void

Draw a filled rectangle on the screen.

extern func draw_rectangle as draw_rectangle(posX: int, posY: int, width: int, height: int, color: int) -> void

Draw a filled triangle on the screen.

extern func draw_triangle as draw_triangle(x1: int, y1: int, x2: int, y2: int, x3: int, y3: int, color: int) -> void

Draw a filled ellipse on the screen.

extern func draw_ellipse as draw_ellipse(centerX: int, centerY: int, radiusX: int, radiusY: int, color: int) -> void

Draw a filled circle on the screen.

extern func draw_circle as draw_circle(centerX: int, centerY: int, radius: int, color: int) -> void

Draw a filled polygon on the screen.

extern func draw_polygon as draw_polygon(points: *int, numPoints: int, color: int) -> void

Draw a filled arc on the screen.

extern func draw_arc as draw_arc(centerX: int, centerY: int, radius: double, startAngle: double, endAngle: double, segments: int, color: int) -> void

Draw a filled round-rectangle on the screen.

extern func draw_rectangle_rounded as draw_rectangle_rounded(x: int, y: int, width: int, height: int, cornerRadius: int, color: int) -> void

Draw an image on the screen.

extern func draw_image as draw_image(src: Image, posX: int, posY: int) -> void

Draw a tinted image on the screen.

extern func draw_image_tint as draw_image_tint(src: Image, posX: int, posY: int, tint: int) -> void

Draw an image, rotated, on the screen.

extern func draw_image_rotated as draw_image_rotated(src: Image, posX: int, posY: int, degrees: double, offsetX: double, offsetY: double, filter: int) -> void

Draw an image, flipped, on the screen.

extern func draw_image_flipped as draw_image_flipped(src: Image, posX: int, posY: int, flipHorizontal: bool, flipVertical: bool, flipDiagonal: bool) -> void

Draw an image, scaled, on the screen.

extern func draw_image_scaled as draw_image_scaled(src: Image, posX: int, posY: int, scaleX: double, scaleY: double, offsetX: double, offsetY: double, filter: int) -> void

Draw some text on the screen.

extern func draw_text as draw_text(font: Font, text: *char, posX: int, posY: int, color: int) -> void

Save an image to persistant storage.

extern func save_image as save_image(image: Image, filename: *char) -> void

Load an image from a file in cart.

extern func load_image as load_image(filename: *char) -> Image

Resize an image, return copy.

extern func image_resize as image_resize(image: Image, newWidth: int, newHeight: int, filter: int) -> Image

Scale an image, return copy.

extern func image_scale as image_scale(image: Image, scaleX: double, scaleY: double, filter: int) -> Image

Replace a color in an image, in-place.

extern func image_color_replace as image_color_replace(image: Image, color: int, replace: int) -> void

Tint a color in an image, in-place.

extern func image_color_tint as image_color_tint(image: Image, color: int) -> void

Fade a color in an image, in-place.

extern func image_color_fade as image_color_fade(image: Image, alpha: double) -> void

Copy a font to a new font.

extern func font_copy as font_copy(font: Font) -> Font

Scale a font, return a new font.

extern func font_scale as font_scale(font: Font, scaleX: double, scaleY: double, filter: int) -> Font

Load a BMF font from a file in cart.

extern func load_font_bmf as load_font_bmf(filename: *char, characters: *char) -> Font

Load a BMF font from an image.

extern func load_font_bmf_from_image as load_font_bmf_from_image(image: Image, characters: *char) -> Font

Measure the size of some text.

extern func measure_text as measure_text(font: Font, text: *char, textLength: int) -> int

Meaure an image (use 0 for screen).

extern func measure_image as measure_image(image: Image) -> int

Load a TTY font from a file in cart.

extern func load_font_tty as load_font_tty(filename: *char, glyphWidth: int, glyphHeight: int, characters: *char) -> Font

Load a TTY font from an image.

extern func load_font_tty_from_image as load_font_tty_from_image(image: Image, glyphWidth: int, glyphHeight: int, characters: *char) -> Font

Load a TTF font from a file in cart.

extern func load_font_ttf as load_font_ttf(filename: *char, fontSize: int) -> Font

Invert the colors in an image, in-place.

extern func image_color_invert as image_color_invert(image: Image) -> void

Calculate a rectangle representing the available alpha border in an image.

extern func image_alpha_border as image_alpha_border(image: Image, threshold: double) -> int

Crop an image, in-place.

extern func image_crop as image_crop(image: Image, x: int, y: int, width: int, height: int) -> void

Crop an image based on the alpha border, in-place.

extern func image_alpha_crop as image_alpha_crop(image: Image, threshold: double) -> void

Adjust the brightness of an image, in-place.

extern func image_color_brightness as image_color_brightness(image: Image, factor: double) -> void

Flip an image, in-place.

extern func image_flip as image_flip(image: Image, horizontal: bool, vertical: bool) -> void

Change the contrast of an image, in-place.

extern func image_color_contrast as image_color_contrast(image: Image, contrast: double) -> void

Use an image as an alpha-mask on another image.

extern func image_alpha_mask as image_alpha_mask(image: Image, alphaMask: Image, posX: int, posY: int) -> void

Create a new image, rotating another image.

extern func image_rotate as image_rotate(image: Image, degrees: double, filter: int) -> Image

Create a new image of a gradient.

extern func image_gradient as image_gradient(width: int, height: int, topLeft: int, topRight: int, bottomLeft: int, bottomRight: int) -> Image

Unload an image.

extern func unload_image as unload_image(image: Image) -> void

Unload a font.

extern func unload_font as unload_font(font: Font) -> void

Clear an image.

extern func clear_image as clear_image(destination: Image, color: int) -> void

Draw a single pixel on an image.

extern func draw_point_on_image as draw_point_on_image(destination: Image, x: int, y: int, color: int) -> void

Draw a line on an image.

extern func draw_line_on_image as draw_line_on_image(destination: Image, startPosX: int, startPosY: int, endPosX: int, endPosY: int, color: int) -> void

Draw a filled rectangle on an image.

extern func draw_rectangle_on_image as draw_rectangle_on_image(destination: Image, posX: int, posY: int, width: int, height: int, color: int) -> void

Draw a filled triangle on an image.

extern func draw_triangle_on_image as draw_triangle_on_image(destination: Image, x1: int, y1: int, x2: int, y2: int, x3: int, y3: int, color: int) -> void

Draw a filled ellipse on an image.

extern func draw_ellipse_on_image as draw_ellipse_on_image(destination: Image, centerX: int, centerY: int, radiusX: int, radiusY: int, color: int) -> void

Draw a circle on an image.

extern func draw_circle_on_image as draw_circle_on_image(destination: Image, centerX: int, centerY: int, radius: int, color: int) -> void

Draw a filled polygon on an image.

extern func draw_polygon_on_image as draw_polygon_on_image(destination: Image, points: *int, numPoints: int, color: int) -> void

Draw a filled round-rectangle on an image.

extern func draw_rectangle_rounded_on_image as draw_rectangle_rounded_on_image(destination: Image, x: int, y: int, width: int, height: int, cornerRadius: int, color: int) -> void

Draw an image on an image.

extern func draw_image_on_image as draw_image_on_image(destination: Image, src: Image, posX: int, posY: int) -> void

Draw a tinted image on an image.

extern func draw_image_tint_on_image as draw_image_tint_on_image(destination: Image, src: Image, posX: int, posY: int, tint: int) -> void

Draw an image, rotated, on an image.

extern func draw_image_rotated_on_image as draw_image_rotated_on_image(destination: Image, src: Image, posX: int, posY: int, degrees: double, offsetX: double, offsetY: double, filter: int) -> void

Draw an image, flipped, on an image.

extern func draw_image_flipped_on_image as draw_image_flipped_on_image(destination: Image, src: Image, posX: int, posY: int, flipHorizontal: bool, flipVertical: bool, flipDiagonal: bool) -> void

Draw an image, scaled, on an image.

extern func draw_image_scaled_on_image as draw_image_scaled_on_image(destination: Image, src: Image, posX: int, posY: int, scaleX: double, scaleY: double, offsetX: double, offsetY: double, filter: int) -> void

Draw some text on an image.

extern func draw_text_on_image as draw_text_on_image(destination: Image, font: Font, text: *char, posX: int, posY: int, color: int) -> void

Draw a outlined (with thickness) rectangle on the screen.

extern func draw_rectangle_outline as draw_rectangle_outline(posX: int, posY: int, width: int, height: int, thickness: int, color: int) -> void

Draw a outlined (with thickness) triangle on the screen.

extern func draw_triangle_outline as draw_triangle_outline(x1: int, y1: int, x2: int, y2: int, x3: int, y3: int, thickness: int, color: int) -> void

Draw a outlined (with thickness) ellipse on the screen.

extern func draw_ellipse_outline as draw_ellipse_outline(centerX: int, centerY: int, radiusX: int, radiusY: int, thickness: int, color: int) -> void

Draw a outlined (with thickness) circle on the screen.

extern func draw_circle_outline as draw_circle_outline(centerX: int, centerY: int, radius: int, thickness: int, color: int) -> void

Draw a outlined (with thickness) polygon on the screen.

extern func draw_polygon_outline as draw_polygon_outline(points: *int, numPoints: int, thickness: int, color: int) -> void

Draw a outlined (with thickness) arc on the screen.

extern func draw_arc_outline as draw_arc_outline(centerX: int, centerY: int, radius: double, startAngle: double, endAngle: double, segments: int, thickness: int, color: int) -> void

Draw a outlined (with thickness) round-rectangle on the screen.

extern func draw_rectangle_rounded_outline as draw_rectangle_rounded_outline(x: int, y: int, width: int, height: int, cornerRadius: int, thickness: int, color: int) -> void

Draw a outlined (with thickness) rectangle on an image.

extern func draw_rectangle_outline_on_image as draw_rectangle_outline_on_image(destination: Image, posX: int, posY: int, width: int, height: int, thickness: int, color: int) -> void

Draw a outlined (with thickness) triangle on an image.

extern func draw_triangle_outline_on_image as draw_triangle_outline_on_image(destination: Image, x1: int, y1: int, x2: int, y2: int, x3: int, y3: int, thickness: int, color: int) -> void

Draw a outlined (with thickness) ellipse on an image.

extern func draw_ellipse_outline_on_image as draw_ellipse_outline_on_image(destination: Image, centerX: int, centerY: int, radiusX: int, radiusY: int, thickness: int, color: int) -> void

Draw a outlined (with thickness) circle on an image.

extern func draw_circle_outline_on_image as draw_circle_outline_on_image(destination: Image, centerX: int, centerY: int, radius: int, thickness: int, color: int) -> void

Draw a outlined (with thickness) polygon on an image.

extern func draw_polygon_outline_on_image as draw_polygon_outline_on_image(destination: Image, points: *int, numPoints: int, thickness: int, color: int) -> void

Draw a outlined (with thickness) round-rectangle on an image.

extern func draw_rectangle_rounded_outline_on_image as draw_rectangle_rounded_outline_on_image(destination: Image, x: int, y: int, width: int, height: int, cornerRadius: int, thickness: int, color: int) -> void
gui (10)

Begin a GUI window. Returns false if the window is collapsed or closed - skip its contents, but still call gui_end_window.

extern func gui_begin_window as gui_begin_window(title: *char, rect: int) -> bool

End the current GUI window.

extern func gui_end_window as gui_end_window() -> void

A button. Returns true when it is clicked.

extern func gui_button as gui_button(label: *char) -> bool

A static text label.

extern func gui_label as gui_label(text: *char) -> void

A block of wrapping text.

extern func gui_text as gui_text(text: *char) -> void

A checkbox. Returns the (possibly changed) state.

extern func gui_checkbox as gui_checkbox(label: *char, state: bool) -> bool

A slider. Returns the (possibly changed) value.

extern func gui_slider as gui_slider(value: double, low: double, high: double) -> double

Set the current layout row - the column widths (negative for flexible), and the row height.

extern func gui_layout_row as gui_layout_row(widths: *int, numWidths: int, height: int) -> void

Finish building the GUI for this frame. Called automatically at the end of update if you do not call it.

extern func gui_end as gui_end() -> void

Draw the GUI to an image (0 is the screen).

extern func gui_draw as gui_draw(dst: Image) -> void
input (12)

Has the key been pressed? (tracks unpress/read correctly.)

extern func key_pressed as key_pressed(key: int) -> bool

Is the key currently down?

extern func key_down as key_down(key: int) -> bool

Has the key been released? (tracks press/read correctly.)

extern func key_released as key_released(key: int) -> bool

Is the key currently up?

extern func key_up as key_up(key: int) -> bool

Has the button been pressed? (tracks unpress/read correctly.)

extern func gamepad_button_pressed as gamepad_button_pressed(gamepad: int, button: int) -> bool

Is the button currently down?

extern func gamepad_button_down as gamepad_button_down(gamepad: int, button: int) -> bool

Has the button been released? (tracks press/read correctly.)

extern func gamepad_button_released as gamepad_button_released(gamepad: int, button: int) -> bool

Get current position of mouse.

extern func mouse_position as mouse_position() -> int

Has the button been pressed? (tracks unpress/read correctly.)

extern func mouse_button_pressed as mouse_button_pressed(button: int) -> bool

Is the button currently down?

extern func mouse_button_down as mouse_button_down(button: int) -> bool

Has the button been released? (tracks press/read correctly.)

extern func mouse_button_released as mouse_button_released(button: int) -> bool

Is the button currently up?

extern func mouse_button_up as mouse_button_up(button: int) -> bool
sound (7)

Load a sound from a file in cart.

extern func load_sound as load_sound(filename: *char) -> Sound

Play a sound.

extern func play_sound as play_sound(sound: Sound, loop: bool) -> void

Stop a sound.

extern func stop_sound as stop_sound(sound: Sound) -> void

Unload a sound.

extern func unload_sound as unload_sound(sound: Sound) -> void

Speak some text and return a sound. Set things to 0 for defaults.

extern func tts_sound as tts_sound(text: *char, phonetic: bool, pitch: int, speed: int, throat: int, mouth: int, sing: bool) -> Sound

Create Sfx sound.

extern func sfx_sound as sfx_sound(params: *int) -> Sound

Create Sfx parameters.

extern func sfx_generate as sfx_generate(type: int) -> *int
tile (38)

Load a tilemap (a Tiled map, exported as JSON) from a file in cart.

extern func load_tilemap as load_tilemap(filename: *char) -> Tilemap

Unload a tilemap.

extern func unload_tilemap as unload_tilemap(tilemap: Tilemap) -> void

Update a tilemap's animation timers (deltaTime is in seconds).

extern func tile_update as tile_update(tilemap: Tilemap, deltaTime: double) -> void

Get the size of a tilemap, in tiles.

extern func tile_map_size as tile_map_size(tilemap: Tilemap) -> int

Get the size of a single tile of a tilemap, in pixels.

extern func tile_tile_size as tile_tile_size(tilemap: Tilemap) -> int

Get a custom property of a tilemap, by name (PROP_NONE when there is no such property.)

extern func tile_map_prop as tile_map_prop(tilemap: Tilemap, name: *char) -> int

Get the number of custom properties on a tilemap.

extern func tile_map_prop_count as tile_map_prop_count(tilemap: Tilemap) -> int

Get a custom property of a tilemap, by index (PROP_NONE when out of range.)

extern func tile_map_prop_at as tile_map_prop_at(tilemap: Tilemap, index: int) -> int

Draw a tilemap on the screen.

extern func tile_draw as tile_draw(tilemap: Tilemap, posX: int, posY: int) -> void

Draw a tilemap on the screen, tinted by a color.

extern func tile_draw_tint as tile_draw_tint(tilemap: Tilemap, posX: int, posY: int, tint: int) -> void

Draw a tilemap on an image.

extern func tile_draw_on_image as tile_draw_on_image(dst: Image, tilemap: Tilemap, posX: int, posY: int) -> void

Render a whole tilemap to a new image.

extern func tilemap_image as tilemap_image(tilemap: Tilemap) -> Image

Get the number of layers in a tilemap. Layers are numbered depth-first, so the children of a group layer have their own indexes too.

extern func tile_layer_count as tile_layer_count(tilemap: Tilemap) -> int

Get the index of a layer of a tilemap, by name (-1 when there is no such layer.)

extern func tile_layer_index as tile_layer_index(tilemap: Tilemap, name: *char) -> int

Get the name of a layer of a tilemap.

extern func tile_layer_name as tile_layer_name(tilemap: Tilemap, layer: int) -> *char

Get the kind of a layer of a tilemap.

extern func tile_layer_type as tile_layer_type(tilemap: Tilemap, layer: int) -> int

Get the size of a layer of a tilemap, in tiles.

extern func tile_layer_size as tile_layer_size(tilemap: Tilemap, layer: int) -> int

Get whether a layer of a tilemap is visible. Drawing a layer that Tiled marked hidden draws nothing.

extern func tile_layer_visible as tile_layer_visible(tilemap: Tilemap, layer: int) -> bool

Get a custom property of a layer of a tilemap, by name (PROP_NONE when there is no such property.)

extern func tile_layer_prop as tile_layer_prop(tilemap: Tilemap, layer: int, name: *char) -> int

Get the number of custom properties on a layer of a tilemap.

extern func tile_layer_prop_count as tile_layer_prop_count(tilemap: Tilemap, layer: int) -> int

Get a custom property of a layer of a tilemap, by index (PROP_NONE when out of range.)

extern func tile_layer_prop_at as tile_layer_prop_at(tilemap: Tilemap, layer: int, index: int) -> int

Draw a single layer of a tilemap on the screen.

extern func tile_draw_layer as tile_draw_layer(tilemap: Tilemap, layer: int, posX: int, posY: int) -> void

Draw a single layer of a tilemap on the screen, tinted by a color.

extern func tile_draw_layer_tint as tile_draw_layer_tint(tilemap: Tilemap, layer: int, posX: int, posY: int, tint: int) -> void

Draw a single layer of a tilemap on an image.

extern func tile_draw_layer_on_image as tile_draw_layer_on_image(dst: Image, tilemap: Tilemap, layer: int, posX: int, posY: int) -> void

Render a single layer of a tilemap to a new image.

extern func tile_layer_image as tile_layer_image(tilemap: Tilemap, layer: int) -> Image

Get the gid of the tile at a column/row in a tilemap layer.

extern func tile_get_tile as tile_get_tile(tilemap: Tilemap, layer: int, column: int, row: int) -> int

Set the gid of the tile at a column/row in a tilemap layer. Swapping a gid is how a cart keeps changing state in the map itself.

extern func tile_set_tile as tile_set_tile(tilemap: Tilemap, layer: int, column: int, row: int, gid: int) -> void

Draw a single tile from a tilemap on the screen.

extern func tile_draw_tile as tile_draw_tile(tilemap: Tilemap, gid: int, posX: int, posY: int) -> void

Get a copy of the image of a single tile in a tilemap.

extern func tile_image as tile_image(tilemap: Tilemap, gid: int) -> Image

Get a custom property of a tile of a tilemap, by name (PROP_NONE when there is no such property.) These come from the tileset, so every tile with this gid shares them.

extern func tile_gid_prop as tile_gid_prop(tilemap: Tilemap, gid: int, name: *char) -> int

Get the number of custom properties on a tile of a tilemap.

extern func tile_gid_prop_count as tile_gid_prop_count(tilemap: Tilemap, gid: int) -> int

Get a custom property of a tile of a tilemap, by index (PROP_NONE when out of range.)

extern func tile_gid_prop_at as tile_gid_prop_at(tilemap: Tilemap, gid: int, index: int) -> int

Get the number of objects on an object-layer of a tilemap.

extern func tile_object_count as tile_object_count(tilemap: Tilemap, layer: int) -> int

Get an object from an object-layer of a tilemap.

extern func tile_object as tile_object(tilemap: Tilemap, layer: int, index: int) -> int

Get the index of an object on an object-layer of a tilemap, by name (-1 when there is no such object.)

extern func tile_object_index as tile_object_index(tilemap: Tilemap, layer: int, name: *char) -> int

Get a custom property of an object of a tilemap, by name (PROP_NONE when there is no such property.)

extern func tile_object_prop as tile_object_prop(tilemap: Tilemap, layer: int, index: int, name: *char) -> int

Get the number of custom properties on an object of a tilemap.

extern func tile_object_prop_count as tile_object_prop_count(tilemap: Tilemap, layer: int, index: int) -> int

Get a custom property of an object of a tilemap, by index (PROP_NONE when out of range.)

extern func tile_object_prop_at as tile_object_prop_at(tilemap: Tilemap, layer: int, index: int, propIndex: int) -> int
utilities (5)

Get system-time (ms) since unix epoch.

extern func current_time as current_time() -> int

Get the change in time (seconds) since the last update run.

extern func delta_time as delta_time() -> double

Get a random integer between 2 numbers.

extern func random_int as random_int(min: int, max: int) -> int

Get the random-seed.

extern func random_seed_get as random_seed_get() -> int

Set the random-seed.

extern func random_seed_set as random_seed_set(seed: int) -> void