main

Procedures

spite-init

spite-init title width height

spite-init

Arguments:

  • title (string)
  • The window title
  • widht (number)
  • Width of the window
  • height
  • Height of the window

Inits Spite and opens a window

spite-start

spite-start new-update-procedure new-draw-procedure

spite-start

Starts the game

spite-started?

spite-started?

spite-started?

Returns: - (boolean) Returns #t if game is started

event-make

event-make

event-type-get

event-type-get

event-data-get

event-data-get

event-push

event-push

event-clear

event-clear

spite-image-load

spite-image-load path

spite-image-load

Arguments:

  • path (string)
  • Path to the image you want to load

Returns: (number) Image index

Loads image from the path, supported filetypes are same as supported by SDL_image https://wiki.libsdl.org/SDL2_image/FrontPage

spite-image-draw

spite-image-draw image-index x y width height

spite-image-draw

Arguments:

  • image-index (number)
  • Index returned by spite-image-load
  • x (number)
  • Images left top corner x position inside the window
  • y (number)
  • Images left top corner y position inside the window
  • width (number)
  • What width should the image be drawn
  • height (number)
  • What height should the image be drawn

spite-image-draw-slice

spite-image-draw-slice image x y width height slice-x slice-y slice-height slice-width

spite-image-draw-slice

Arguments:

  • image-index (number)
  • Index returned by spite-image-load
  • x (number)
  • Images left top corner x position inside the window
  • y (number)
  • Images left top corner y position inside the window
  • width (number)
  • What width should the slice be drawn
  • height (number)
  • What height should the slice be drawn
  • slice-x (number)
  • Slices top left corner x position inside the image
  • slice-y (number)
  • Slices top left corner y position inside the image
  • slice-height
  • Slices height
  • slice-width
  • Slices width

Slice here refers to rectangle inside the image. So instead of drawing the whole image, only the slice is drawn

spite-point-draw

spite-point-draw x y size color

spite-point-draw

Arguments: - x (number) The x position of the point - y (number) The y position of the point - size (number) How big the point should be - color (list number number number number) Red green blue and alpha as a list

spite-line-draw

spite-line-draw x1 y1 x2 y2 line-size color

spite-line-draw

Arguments: - point-1-x (number) - point-1-y (number) - point-2-x (number) - point-2-y (number) - size (number) How big the line should be - color (list number number number number) Red green blue and alpha as list

spite-rectangle-draw

spite-rectangle-draw left-top-point-x left-top-point-y width height line-size color

spite-rectangle-draw

Arguments: - left-top-point-x (number) - left-top-point-y (number) - width (number) - height (number) - line-size (number) - color (list number number number number) Red green blue and alpha as list

spite-rectangle-fill

spite-rectangle-fill left-top-point-x left-top-point-y width height color

spite-rectangle-fill

Arguments: - left-top-point-x (number) - left-top-point-y (number) - width (number) - height (number) - color (list number number number number) Red green blue and alpha as list

spite-polygon-draw

spite-polygon-draw points line-size color

spite-font-load

spite-font-load path size

spite-font-load

Arguments:

  • path (string)
  • Path to the font file you want to load
  • size (number)
  • The size the font should be

Returns: (number) Index of the loaded font

Supports any font format SDL_format supports ;> https://wiki.libsdl.org/SDL2_ttf/FrontPage

spite-text-draw

spite-text-draw text x y font color

spite-text-draw

Arguments:

  • text (string)
  • Text you want to draw
  • x (number)
  • Left top corner x position of the text inside the window
  • y (number)
  • Left top corner y position of the text inside the window
  • font (number)
  • Font index returned by spite-font-load
  • color (list number number number number)
  • Red green blue and alpha as a list

spite-window-resizing-allow

spite-window-resizing-allow

spite-window-resizing-allow

By default resizing is not allowed

spite-window-resizing-disallow

spite-window-resizing-disallow

spite-window-resizing-disallow

By default resizing is not allowed

spite-renderer-size-set

spite-renderer-size-set width height

spite-renderer-size-set

Arguments: - width (number) Set the renderer width - height (number) Set the renderer height

time-as-milliseconds

time-as-milliseconds

time-as-seconds

time-as-seconds

time-interval

time-interval

time-timeout

time-timeout