love module reference

love module reference

LÖVE graphics.

This module implements basic graphics using the love2d game engine.

running

In order to use this module, the copilot has to be started in a specific way:

$ love bin/alv-love <session.alv>

usage

The love/draw ops can be used to draw one or more love/shapes in a fixed stacking order. love/shapes can be created using love/rectangle etc, and positioned and styled using the modifier ops like love/translate, love/color and so on. All modifier ops take the shape as the last input and output a modified shape, and can be used comfortably with the thread-last macro ->>:

(import* love math)
(draw (->>
  (rectangle 'fill' 100 100)
  (color 1 0 0)
  (rotate (/ pi 4))
  (translate 150 150)))

index

details