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 2489 times – 60.56 KBInstructions
- Download the plugin and place it in your js/plugins folder.
- Add the plugin near the top of your PluginManager plugin list — above any EIS plugins.
- Enjoy all the awesome API functions!
Documentation
Web
Amaryllis : object
Kind: global namespace
- Amaryllis :
object
- .Timer
- new Timer()
- .Timer#startTimer()
- .Timer#setTimer(value)
- .Timer#timeUp() ⇒
boolean
- .Timer#frames() ⇒
number
- .Stream ⇐
PIXI.utils.EventEmitter
- new Stream()
- .Stream#on(eventName, handler, context) ⇒
Stream
- .Stream#next() ⇒
T
- .Stream#filter(f) ⇒
Stream
- .Stream#map(f) ⇒
Stream
- .Stream#reduce(start, f) ⇒
Array.<any>
- .Stream#each(f) ⇒
Array.<any>
- .Stream#size() ⇒
number
- .Stream#array() ⇒
Array.<any>
- .Stream#read() ⇒
Array.<any>
- .Game :
object
- .Str :
object
- .capitalize(string) ⇒
string
- .title(string) ⇒
string
- .capitalize(string) ⇒
- .Num :
object
- .clamp(min, max) ⇒
number
- .floorRand(number) ⇒
number
- .ceilRand(number) ⇒
number
- .clamp(min, max) ⇒
- .Util :
object
- .executeCode(code)
- .currentScene() ⇒
Scene
- .splitPath(path) ⇒
object
- .stringify(data) ⇒
string
- .parse(string) ⇒
object
- .lines(number) ⇒
number
- .rgbToCss(red, green, blue) ⇒
string
- .isNwjs() ⇒
boolean
- .isMobile()
- .isTest() ⇒
boolean
- .isPlaytest() ⇒
boolean
- .showError(msg)
- .Functional :
object
- .clone() ⇒
object
- .freeze() ⇒
object
- .freezeClone() ⇒
- .flatten(array) ⇒
Array.<any>
- .trace(label, val)
- .pipe(fns) ⇒
function
- .compose(fns)
- .task()
- .make() ⇒
function
- .map(f, object) ⇒
T
- .filter(f, object) ⇒
T
- .range(start, end) ⇒
array
- .take(amount, list) ⇒
Array.<any>
- .drop(amount, list) ⇒
Array.<any>
- .negate(number) ⇒
number
- .toBoolean(string) ⇒
boolean
- .pluck(key) ⇒
any
- .pick(list, [index]) ⇒
T
- .identity(variable) ⇒
T
- .isEmpty(variable) ⇒
boolean
- .clone() ⇒
- .Timer
Amaryllis.Timer
Kind: static class of Amaryllis
- .Timer
- new Timer()
- .Timer#startTimer()
- .Timer#setTimer(value)
- .Timer#timeUp() ⇒
boolean
- .Timer#frames() ⇒
number
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
- .Stream ⇐
PIXI.utils.EventEmitter
- new Stream()
- .Stream#on(eventName, handler, context) ⇒
Stream
- .Stream#next() ⇒
T
- .Stream#filter(f) ⇒
Stream
- .Stream#map(f) ⇒
Stream
- .Stream#reduce(start, f) ⇒
Array.<any>
- .Stream#each(f) ⇒
Array.<any>
- .Stream#size() ⇒
number
- .Stream#array() ⇒
Array.<any>
- .Stream#read() ⇒
Array.<any>
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 :
object
- .capitalize(string) ⇒
string
- .title(string) ⇒
string
- .capitalize(string) ⇒
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 :
object
- .clamp(min, max) ⇒
number
- .floorRand(number) ⇒
number
- .ceilRand(number) ⇒
number
- .clamp(min, max) ⇒
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 :
object
- .executeCode(code)
- .currentScene() ⇒
Scene
- .splitPath(path) ⇒
object
- .stringify(data) ⇒
string
- .parse(string) ⇒
object
- .lines(number) ⇒
number
- .rgbToCss(red, green, blue) ⇒
string
- .isNwjs() ⇒
boolean
- .isMobile()
- .isTest() ⇒
boolean
- .isPlaytest() ⇒
boolean
- .showError(msg)
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 :
object
- .clone() ⇒
object
- .freeze() ⇒
object
- .freezeClone() ⇒
- .flatten(array) ⇒
Array.<any>
- .trace(label, val)
- .pipe(fns) ⇒
function
- .compose(fns)
- .task()
- .make() ⇒
function
- .map(f, object) ⇒
T
- .filter(f, object) ⇒
T
- .range(start, end) ⇒
array
- .take(amount, list) ⇒
Array.<any>
- .drop(amount, list) ⇒
Array.<any>
- .negate(number) ⇒
number
- .toBoolean(string) ⇒
boolean
- .pluck(key) ⇒
any
- .pick(list, [index]) ⇒
T
- .identity(variable) ⇒
T
- .isEmpty(variable) ⇒
boolean
- .clone() ⇒
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 |
If you’d like to get involved join the email list below or the discord channel.