Skip to content
This repository has been archived by the owner on Dec 24, 2023. It is now read-only.

Commit

Permalink
More docs
Browse files Browse the repository at this point in the history
  • Loading branch information
deathbeam committed Jul 13, 2015
1 parent 49f239a commit cbb8879
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/non/objects/File.moon
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class File
-- @tparam File self
-- @string text The string data to append to the file.
-- @usage
-- file\append text
-- File\append text
append: (text) =>
@file\writeString text, true
return true
Expand All @@ -36,7 +36,7 @@ class File
-- @tparam File self
-- @tparam File to The destination file.
-- @usage
-- file\copy to
-- File\copy to
copy: (to) =>
@file\copyTo to
return true
Expand Down
4 changes: 2 additions & 2 deletions src/non/objects/Quad.moon
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Quad
-- @treturn number w The width of the viewport.
-- @treturn number h The height of the viewport.
-- @usage
-- x, y, width, height = quad\getViewport!
-- x, y, width, height = Quad\getViewport!
getViewport: =>
@x, @y, @w, @h

Expand All @@ -33,7 +33,7 @@ class Quad
-- @number w The width of the viewport.
-- @number h The height of the viewport.
-- @usage
-- quad\setViewport x, y, width, height
-- Quad\setViewport x, y, width, height
setViewport: (x, y, w, h) =>
@x = x
@y = y
Expand Down
71 changes: 68 additions & 3 deletions src/non/objects/Source.moon
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ class Source
else
@source = Gdx.audio\newSound file.file

---
-- Starts playing the Source.
-- @tparam Source self
-- @usage
-- Source\play!
play: =>
if @static
@soundId = @source\play!
Expand All @@ -28,6 +33,11 @@ class Source

@playing = false

---
-- Pauses the Source
-- @tparam Source self
-- @usage
-- Source\pause!
pause: =>
if @paused return

Expand All @@ -38,6 +48,11 @@ class Source

@paused = true

---
-- Resumes a paused Source
-- @tparam Source self
-- @usage
-- Source\resume!
resume: =>
if not @paused return

Expand All @@ -46,6 +61,11 @@ class Source
else
@source\pause!

---
-- Stops a Source
-- @tparam Source self
-- @usage
-- Source\stop!
stop: =>
if not @playing return

Expand All @@ -57,27 +77,66 @@ class Source

@playing = true

---
-- Returns a type of a Source
-- @tparam Source self
-- @treturn string Type of a Source ("static" or "stram")
-- @usage
-- type = Source\getType!
getType: =>
@static and "static" or "stream"

---
-- Gets the current volume of the Source.
-- @tparam Source self
-- @treturn number Volume of a Source
-- @usage
-- volume = Source\getVolume!
getVolume: =>
@volume

---
-- Returns whether the Source will loop.
-- @tparam Source self
-- @treturn bool True if the Source will loop, false otherwise.
-- @usage
-- loop = Source\isLooping!
isLooping: =>
@looping

---
-- Returns whether the Source is paused.
-- @tparam Source self
-- @treturn bool True if the Source is paused, false otherwise.
-- @usage
-- paused = Source\isPaused!
isPaused: =>
@paused

---
-- Returns whether the Source is playing.
-- @tparam Source self
-- @treturn bool True if the Source is playing, false otherwise.
-- @usage
-- playing = Source\isPlaying!
isPlaying: =>
@playing

isStatic: =>
@static

---
-- Returns whether the Source is stopped.
-- @tparam Source self
-- @treturn bool True if the Source is stopped, false otherwise.
-- @usage
-- stopped = Source\isStopped!
isStopped: =>
not @playing

---
-- Sets whether the Source should loop.
-- @tparam File self
-- @tparam bool looping True if the source should loop, false otherwise.
-- @usage
-- Source\setLooping looping
setLooping: (looping) =>
@looping = looping

Expand All @@ -86,6 +145,12 @@ class Source
else
@source\setLooping @looping

---
-- Sets the current volume of the Source.
-- @tparam File self
-- @tparam number volume The volume for a Source, where 1.0 is normal volume. Volume cannot be raised above 1.0.
-- @usage
-- Source\setVolume volume
setVolume: (volume) =>
@volume = volume

Expand Down

0 comments on commit cbb8879

Please sign in to comment.