Unverified Commit 20b6a69a authored by RobLoach's avatar RobLoach
Browse files

Update documentation

parent fc81a16b
......@@ -4,7 +4,7 @@ All notable changes to [ChaiLove](https://github.com/RobLoach/ChaiLove) will be
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
## 0.26.0 - Unreleased
## 0.26.0 - 2018-09-13
### Features
- Added a global `require()` function to load modules ([#308](https://github.com/libretro/libretro-chailove/pull/308))
- Added OEM-102 key support (sometimes `\` on EUR keyboard) ([#309](https://github.com/libretro/libretro-chailove/pull/309))
......
......@@ -28,7 +28,7 @@ def load() {
sprites.push_back(Sprite())
// Load the music.
music = love.audio.newSource("music.wav")
music = love.audio.newSource("music.ogg")
music.setLooping(true)
music.play()
}
......
......@@ -47,7 +47,7 @@ global T
def conf(t) {
t.window.width = WIDTH * gridScale
t.window.height = HEIGHT * gridScale
t.version = "0.19.1"
t.version = "0.26.0"
}
/**
......
......@@ -41,6 +41,8 @@ class audio {
* Returns the master volume.
*
* @return The current master volume between 0.0f and 1.0f.
*
* @see setVolume
*/
float getVolume();
......@@ -50,6 +52,8 @@ class audio {
* @param volume 1.0f is max and 0.0f is off.
*
* @return The audio module, to allow method chaining.
*
* @see getVolume
*/
audio& setVolume(float volume);
......
......@@ -30,11 +30,15 @@ class console {
/**
* Checks to see if the console is enabled.
*
* @see setEnabled
*/
bool isEnabled();
/**
* Enable or disable the console.
*
* @see isEnabled
*/
bool setEnabled(bool enabled);
......
......@@ -68,6 +68,8 @@ class graphics {
/**
* Draws a point.
*
* @param p The point to draw on the screen.
*/
graphics& point(Point* p);
......@@ -131,12 +133,16 @@ class graphics {
* Set an already-loaded Font as the current font.
*
* @param (font) The font to set as the active font. When not provided will set the default font.
*
* @see getFont
*/
graphics& setFont(Font* font);
graphics& setFont();
/**
* Retrieve th currently active font.
*
* @see setFont
*/
Font* getFont();
......@@ -161,6 +167,8 @@ class graphics {
* @param green The amount of green.
* @param blue The amount of blue.
* @param alpha (255) The amount of alpha.
*
* @see getColor
*/
graphics& setColor(int red, int green, int blue, int alpha);
graphics& setColor(int red, int green, int blue);
......
......@@ -15,7 +15,7 @@ def conf(t) {
t.window.width = 460
t.window.height = 320
t.console = true
t.version = "0.24.0"
t.version = "0.26.0"
}
def load() {
......
......@@ -6,7 +6,7 @@ assert_equal(love.audio.getVolume(), 0.5f, "love.audio.getVolume()")
// newSource()
var audio_sound = love.audio.newSource("assets/jump.wav")
assert_not(audio_sound.is_var_null(), "love.audio.newSource()")
assert_not(audio_sound.is_var_null(), "love.audio.newSource('wav')")
// play()
var audioplayResult = audio_sound.play()
......
......@@ -16,15 +16,15 @@ assert(found > 50, "love.filesystem.read()")
// exists()
assert(love.filesystem.exists("math.chai"), "love.filesystem.exists('math.chai')")
assert(!love.filesystem.exists("notexist.chai"), "love.filesystem.exists('notexist.chai')")
assert(!love.filesystem.exists("notexist.chai"), " On non existant file")
// getSize()
assert(love.filesystem.getSize("filesystem.chai") > 10, "love.filesystem.getSize()")
assert_equal(love.filesystem.getSize("notexist.chai"), -1, "love.filesystem.getSize('notexist.chai')")
assert_equal(love.filesystem.getSize("notexist.chai"), -1, " On non existant file")
// isFile()
assert(love.filesystem.isFile("filesystem.chai"), "love.filesystem.isFile()")
assert(!love.filesystem.isFile("notexist.chai"), "love.filesystem.isFile('notexist.chai')")
assert(!love.filesystem.isFile("notexist.chai"), " On non existant file")
// isDirectory()
assert_not(love.filesystem.isDirectory("keyboard.chai"), "love.filesystem.isDirectory()")
......@@ -72,17 +72,21 @@ assert(mountResult, "love.filesystem.mount()")
// mount() - Load
var mountLoadResult = love.filesystem.read("hello/hello.txt")
var mountLoadResultType = is_type(mountLoadResult, "string")
assert(mountLoadResultType, "love.filesystem.mount() & read() == 'string'")
assert(mountLoadResultType, " read()")
if (mountLoadResultType) {
assert_equal(mountLoadResult.trim(), "Hello World!", "love.filesystem.mount() & read()")
assert_equal(mountLoadResult.trim(), "Hello World!", " contents")
}
// unmount()
love.filesystem.unmount("test/unittests/assets/hello.zip")
assert_not(love.filesystem.exists("hello/hello.txt"), "love.filesystem.unmount()")
// require()
global requiretestFileLoaded = false
var requireReturn = require("assets.requiretest")
assert(requireReturn, "require()")
assert(requiretestFileLoaded, " - global")
assert(requiretestFileLoaded, " global")
requiretestFileLoaded = false
requireReturn = require("assets.requiretest")
assert(requireReturn, " - double call")
assert_not(requiretestFileLoaded, " - not loaded twice")
assert(requireReturn, " double call")
assert_not(requiretestFileLoaded, " not loaded twice")
// newSoundData()
var theSound = love.sound.newSoundData("assets/jump.wav")
assert_not(theSound.is_var_null(), "love.sound.newSoundData()")
assert_not(theSound.is_var_null(), "love.sound.newSoundData('wav')")
// newSoundData() with OGG
var theOgg = love.sound.newSoundData("assets/chailove.ogg")
assert_not(theOgg.is_var_null(), " - ogg")
assert_not(theOgg.is_var_null(), " ogg")
// getVolume()
assert_equal(theSound.getVolume(), 1.0f, "SoundData.getVolume()")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment