Skip to content

Instantly share code, notes, and snippets.

@KinoAR
Last active September 16, 2017 23:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KinoAR/ea74a5a7cc2a5b36df29d92685fca41f to your computer and use it in GitHub Desktop.
Save KinoAR/ea74a5a7cc2a5b36df29d92685fca41f to your computer and use it in GitHub Desktop.
Documentation for Amaryllis plugin.

Amaryllis : object

Kind: global namespace

Amaryllis.Timer

Kind: static class of Amaryllis

new Timer()

A Timer class for utility purposes and timing events in frames.

Timer.Timer#startTimer()

Starts the timer; resetting it if its been used.

Kind: static method of Timer

Timer.Timer#setTimer(value)

Sets the timer to the specified number in seconds.

Kind: static method of Timer

Param Type
value number

Timer.Timer#timeUp() ⇒ boolean

Returns true iff the timer is out of time.

Kind: static method of Timer

Timer.Timer#frames() ⇒ number

Number of frames of the timer; defaults to 60.

Kind: static method of Timer

Amaryllis.Stream ⇐ PIXI.utils.EventEmitter

Kind: static class of Amaryllis
Extends: PIXI.utils.EventEmitter

new Stream()

Stream class for dealing with large amounts of data.

Stream.Stream#on(eventName, handler, context) ⇒ Stream

Attaches an event handler to the current stream and returns it for chaining function calls.

Kind: static method of Stream

Param Type
eventName string
handler function
context *

Stream.Stream#next() ⇒ T

Returns the next value in the stream.

Kind: static method of Stream

Stream.Stream#filter(f) ⇒ Stream

Returns a new stream with the filter function used on all elements.

Kind: static method of Stream

Param Type
f function

Stream.Stream#map(f) ⇒ Stream

Returns a new stream with the map function used on all elements.

Kind: static method of Stream

Param Type
f function

Stream.Stream#reduce(start, f) ⇒ Array.<any>

Returns an array of the streams elements from the specified staring point.

Kind: static method of Stream

Param Type
start number
f function

Stream.Stream#each(f) ⇒ Array.<any>

Runs the function for each element in the stream.

Kind: static method of Stream

Param Type
f function

Stream.Stream#size() ⇒ number

Returns the size of the stream's internal buffer.

Kind: static method of Stream

Stream.Stream#array() ⇒ Array.<any>

Returns the stream's internal buffer as an array.

Kind: static method of Stream

Stream.Stream#read() ⇒ Array.<any>

Returns the internal buffer.

Kind: static method of Stream

Amaryllis.Game : object

Kind: static namespace of Amaryllis

Game.setSwitches(start, end, value)

Sets a range of game switches to the given value.

Kind: static method of Game

Param Type
start number
end number
value boolean

Game.setVariables(start, end, value)

Sets a range of game variables to the given value.

Kind: static method of Game

Param Type
start number
end number
value *

Amaryllis.Str : object

Kind: static namespace of Amaryllis

Str.capitalize(string) ⇒ string

Returns a capitalized version of the string.

Kind: static method of Str

Param Type
string string

Str.title(string) ⇒ string

Returns a version of the string with all words capitalized.

Kind: static method of Str

Param Type
string string

Amaryllis.Num : object

Kind: static namespace of Amaryllis

Num.clamp(min, max) ⇒ number

Clamps the number between the specified min and max.

Kind: static method of Num

Param Type
min number
max number

Num.floorRand(number) ⇒ number

Returns a floored random number.

Kind: static method of Num

Param Type
number number

Num.ceilRand(number) ⇒ number

Returns a ceil random number.

Kind: static method of Num

Param Type
number number

Amaryllis.Util : object

Kind: static namespace of Amaryllis

Util.executeCode(code)

Runs the provide JavaScript code regardless of if it's a function or a string.

Kind: static method of Util

Param Type
code string | function

Util.currentScene() ⇒ Scene

Returns the current SceneManager._scene.

Kind: static method of Util

Util.splitPath(path) ⇒ object

Splits a path into a folder and file property object.

Kind: static method of Util

Param Type
path string

Util.stringify(data) ⇒ string

Stringifys the data and compresses it in production mode.

Kind: static method of Util

Param Type
data *

Util.parse(string) ⇒ object

Parses the data; if it's it production mode it will be decompressed.

Kind: static method of Util

Param Type
string string

Util.lines(number) ⇒ number

Returns a number based on the game's default lineHeight.

Kind: static method of Util

Param Type
number number

Util.rgbToCss(red, green, blue) ⇒ string

Returns a rgb in css format string.

Kind: static method of Util

Param Type
red number
green number
blue number

Util.isNwjs() ⇒ boolean

Returns true if the game is running on desktop(nwjs).

Kind: static method of Util

Util.isMobile()

Returns true if the game is running on mobile.

Kind: static method of Util
Returns{boolean}:

Util.isTest() ⇒ boolean

Returns true if the game is in test mode.

Kind: static method of Util

Util.isPlaytest() ⇒ boolean

Returns true if the game is in play test mode.

Kind: static method of Util

Util.showError(msg)

Shows an error msg if the game is on desktop and in play test opening the Dev Console.

Kind: static method of Util

Param Type
msg string

Amaryllis.Functional : object

Kind: static namespace of Amaryllis

Functional.clone() ⇒ object

Clones an object removing it's dependencies.

Kind: static method of Functional

Functional.freeze() ⇒ object

Freezes an object preventing it from being modified.

Kind: static method of Functional

Functional.freezeClone() ⇒

Freezes and clones an object.

Kind: static method of Functional
Returns: object

Functional.flatten(array) ⇒ Array.<any>

Flattens an array of arrays into a single array.

Kind: static method of Functional
Template: T

Param Type
array Array.<Array.<T>>

Functional.trace(label, val)

Allows you to trace information through a function call.

Kind: static method of Functional

Param Type
label any
val any

Functional.pipe(fns) ⇒ function

Returns a function that is a combination of all the entered functions. Processing is done left to right.

Kind: static method of Functional

Param Type
fns any

Functional.compose(fns)

Returns a function that is a combination of all entered functions. Processing is done right to left.

Kind: static method of Functional

Param Type
fns any

Functional.task()

Returns a function that can be executed later.

Kind: static method of Functional

Functional.make() ⇒ function

Creates a function prototype that extends the other function prototype.

Kind: static method of Functional

Functional.map(f, object) ⇒ T

General purpose map; works on all iterable objects.

Kind: static method of Functional
Template: T

Param Type
f function
object T

Functional.filter(f, object) ⇒ T

General purpose filter; works on all iterable objects.

Kind: static method of Functional
Template: T

Param Type
f function
object T

Functional.range(start, end) ⇒ array

Returns an array of numbers of the given range.

Kind: static method of Functional

Param Type
start number
end number

Functional.take(amount, list) ⇒ Array.<any>

Takes a set amount of elements from the start of an array.

Kind: static method of Functional

Param Type
amount number
list Array.<any>

Functional.drop(amount, list) ⇒ Array.<any>

Takes a set amount of elements from the end of an array.

Kind: static method of Functional

Param Type
amount number
list Array.<any>

Functional.negate(number) ⇒ number

Negates a number

Kind: static method of Functional

Param Type
number number

Functional.toBoolean(string) ⇒ boolean

Turns the string into a boolean.

Kind: static method of Functional

Param Type
string string

Functional.pluck(key) ⇒ any

Takes the value of a key from an object.

Kind: static method of Functional

Param Type
key string

Functional.pick(list, [index]) ⇒ T

Returns an element from an array by index; if no index is provided return a random element.

Kind: static method of Functional
Template: T

Param Type
list Array.<T>
[index] number

Functional.identity(variable) ⇒ T

Returns the element entered.

Kind: static method of Functional
Template: T

Param Type
variable T

Functional.isEmpty(variable) ⇒ boolean

Returns true if the element given is empty.

Kind: static method of Functional
Template: T

Param Type
variable T
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment