A core plugin that functions as an API to improve development speed.

Many plugins in the EIS Library will be using this plugin in the future, so download it to ensure a smooth experience.

Version 1.2.0

Features

  • Helper Functions
  • Stream Class
  • Load Data via Promises
  • Event Emitter Utility
  • Compatible with other Plugins
  • Documented Code
  • Namespaces for code organization
  • Parser for MV 1.5 Plugin Parameters
  • Get plugin parameters via regular expression through plugin description. (Never care about your plugin file name again).

Download

Download “Amaryllis” Amaryllis.js – Downloaded 2386 times – 61 KB

Instructions

  1. Download the plugin and place it in your js/plugins folder.
  2. Add the plugin near the top of your PluginManager plugin list — above any EIS plugins.
  3. Enjoy all the awesome API functions!

Documentation

Web

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
view raw Amaryllis.md hosted with ❤ by GitHub

If you’d like to get involved join the email list below or the discord channel.

%d bloggers like this: