ChaiLove API  0.28.0
Data Structures
love Namespace Reference

This covers all the modules available through ChaiLove. More...

Data Structures

class  audio
 Provides an interface to output sound to the user's speakers. More...
 
class  config
 The configuration object for ChaiLove. More...
 
class  console
 In-game console for ChaiLove. More...
 
class  data
 Provides functionality for creating and transforming data. More...
 
class  event
 Manages events, like keypresses. More...
 
class  filesystem
 Provides an interface to the user's filesystem. More...
 
class  font
 Allows you to work with fonts. More...
 
class  graphics
 The primary purpose of the graphics module is to draw to the screen. More...
 
class  image
 Provides an interface to decode encoded image data. More...
 
class  joystick
 Provides an interface to connected joysticks. More...
 
class  keyboard
 Provides an interface to the user's keyboard. More...
 
class  math
 Provides system-independent mathematical functions. More...
 
class  mouse
 Provides an interface to the user's mouse. More...
 
class  script
 This module provides all the global functions and events that are called. More...
 
class  sound
 This module is responsible for decoding sound files. More...
 
class  system
 Provides access to information about the user's system. More...
 
class  timer
 Provides high-resolution timing functionality. More...
 
class  window
 Provides an interface for modifying and retrieving information about the program's window. More...
 

Detailed Description

This covers all the modules available through ChaiLove.

In addition to the modules, there are the callbacks. load() is called when loading the game, update(dt) when updating the game state, and draw() when looking to render the game. The following an example of these callbacks below...

global x = 20
global y = 20
global w = 60
global h = 20
// ChaiLove callback; Load the game.
def load() {
// Do something when the game loads.
}
// ChaiLove callback; Update the game state.
def update(dt) {
// Increase the size of the rectangle every frame.
w = w + 1
h = h + 1
}
// ChaiLove callback; Draw the game.
def draw() {
love.graphics.setColor(0, 100, 100)
love.graphics.rectangle("fill", x, y, w, h)
}

Callbacks