Here is my very first plugin for Construct 2! *drum rolls*
<font size="6">Extra Expressions</font>
<font size="3"><font color="red">Version: 1.1 (11th January)</font></font>
<font size="3">Download ExtraExps.zip</font>
To install, extract the contents to Construct 2\exporters\html5\plugins folder.
To use, simply start entering an expression where applicable, like this:
Tip: You can rename the object to a suitable shorthand, such as ExtExp
The plugin contains miscelaneous expressions that complement the system expressions. It is kind of pointless to create a plugin for each expression, so I decided to create Extra Expressions plugin containing all regularly used expressions.
<font size="3">LIST OF EXPRESSIONS</font>
find(text, source) - Case sensitive version of system find expression. Find text within source text.
char2code(char) - Returns the charcode of a character (or the first character of string)
code2char(code) - Returns the character from charcode
cosp(a,b,t) - Cosine interpolation between points a and b
--- NEW ---
offsetX(x,angle,distance) - Returns the x position at an offset by distance at angle.
offsetY(y,angle,distance) - Returns the y position at an offset by distance at angle.
snap(number,gridsize) - Returns the number snapped to grid size (e.g. 25.5 snapped to 16 returns 32).
encode(string) - Encode the string to Base64
decode(base64) - Decode the encoded string from Base64
findToken(text,token,delimiter,case sensitivity (0 or 1)) - Find token in text, returns its index if found or -1 if not found.
Yeah, just a few expressions for now, but be sure that I will be adding more. Got any suggestions? Better terminology? Drop a line here!