api/tic80

Source   Edit  

Procs

proc btn(index: Button): bool {.inline, ...raises: [], tags: [], forbids: [].}
Get gamepad button state in current frame. Source   Edit  
proc btnp(index: Button; hold: int32 = -1; period: int32 = -1): bool {.inline,
    ...raises: [], tags: [], forbids: [].}
Get gamepad button state according to previous frame. Source   Edit  
proc exit() {.noreturn, ...raises: [], tags: [], forbids: [].}
Interrupts program and returns to console. Source   Edit  
proc font(text: cstring; x, y: int32; transColor, char_width, char_height: int8;
          fixed: bool; scale: int8; alt: bool): int8 {.discardable, ...raises: [],
    tags: [], forbids: [].}
Print a string using foreground sprite data as the font. Source   Edit  
proc map(x: int32 = 0; y: int32 = 0; w: int32 = 30; h: int32 = 17;
         sx: int32 = 0; sy: int32 = 0; transColor: Color = Null;
         scale: int8 = 1; remap: int32 = -1) {....raises: [], tags: [], forbids: [].}
Draw a map region. Source   Edit  
proc mouse(): MouseState {.inline, ...raises: [], tags: [], forbids: [].}
Get XY and press state of mouse/touch. Source   Edit  
proc pixget(x, y: int32): uint8 {....raises: [], tags: [], forbids: [].}
Get the color of a single pixel. Source   Edit  
proc pixset(x, y: int32; color: Color) {....raises: [], tags: [], forbids: [].}
Set the color of a single pixel. Source   Edit  
proc pmemget(address: int32): uint32 {....raises: [], tags: [], forbids: [].}
Access the persistent memory. Source   Edit  
proc pmemset(address: int32; value: int64) {....raises: [], tags: [], forbids: [].}
Update the persistent memory. Source   Edit  
proc spr(id, x, y: int32; transColor: Color = Null; scale: int32 = 1;
         flip: int32 = 0; rotate: int32 = 0; w: int32 = 1; h: int32 = 1) {.
    ...raises: [], tags: [], forbids: [].}
Draw a sprite or composite sprite. Source   Edit  
proc time(): cfloat {....raises: [], tags: [], forbids: [].}
Returns how many milliseconds have passed since game started. Source   Edit  
proc trace(arr: varargs[string, `$`]) {....raises: [], tags: [], forbids: [].}
trace() that accepts one or more arguments and converts them to string, similar to echo Source   Edit  
proc trace(s: string) {....raises: [], tags: [], forbids: [].}
Print a string to the Console. Source   Edit  
proc ttri(x1, y1, x2, y2, x3, y3, u1, v1, u2, v2, u3, v3: cfloat;
          texsrc: int32 = 0; transColor: Color = Null; z1: cfloat = 0.0;
          z2: cfloat = 0.0; z3: cfloat = 0.0; depth = false) {....raises: [],
    tags: [], forbids: [].}
Draw a triangle filled with texture. Source   Edit  

Macros

macro exportWasm(def: untyped): untyped
Source   Edit