From 309e6de9706fc32e296780ddfc5c3a0fe32a5124 Mon Sep 17 00:00:00 2001 From: Valerio Santinelli Date: Fri, 20 Oct 2023 17:57:44 +0200 Subject: [PATCH] More API doc --- assets/api/audio.lua | 3 ++- assets/api/sprite.lua | 4 ++++ assets/main.lua | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/assets/api/audio.lua b/assets/api/audio.lua index 75fee54..02409ad 100644 --- a/assets/api/audio.lua +++ b/assets/api/audio.lua @@ -53,8 +53,9 @@ function audio.load_sound(audio, filename) end ---@return AudioSound the sound function audio.load_sound_from_assets(audio, filename) end +---@param audio Audio the audio system ---@param sound AudioSound the sound to play -function audio.play_sound(sound) end +function audio.play_sound(audio, sound) end ---@param sound AudioSound the sound to play ---@param volume number the volume 0..1 diff --git a/assets/api/sprite.lua b/assets/api/sprite.lua index 9bf64da..08ea049 100644 --- a/assets/api/sprite.lua +++ b/assets/api/sprite.lua @@ -44,4 +44,8 @@ function sprite.set_subtexture(sprite, subtexture) end ---@param y number the vertical position of the origin function sprite.set_origin(sprite, x, y) end +---Destroy the sprite instance +---@param sprite Sprite the sprite instance +function sprite.destroy(sprite) end + return sprite \ No newline at end of file diff --git a/assets/main.lua b/assets/main.lua index 68a3eb3..b1992dd 100644 --- a/assets/main.lua +++ b/assets/main.lua @@ -127,7 +127,7 @@ function on_init() io.write("sb: " .. tostring(sb) .. "\n") -- Create a viewport that corresponds to the size of our render target - center = lkazmath.kmVec2New(); + local center = lkazmath.kmVec2New(); center.x = const.DESIGN_WIDTH / 2; center.y = const.DESIGN_HEIGHT / 2; viewport = lkazmath.kmAABB2New();