Massive update, incl. dynamic documentation.
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
function Angle(angle_str)
|
||||
function Angle(angle_str = "0'")
|
||||
{
|
||||
Unit.call(this);
|
||||
|
||||
this.example = "45'";
|
||||
|
||||
this.degrees = parseFloat(angle_str.replace('\'',''));
|
||||
|
||||
this.render = function()
|
||||
|
||||
@@ -2,6 +2,7 @@ function Any(str)
|
||||
{
|
||||
Unit.call(this);
|
||||
|
||||
this.example = "";
|
||||
this.string = str;
|
||||
|
||||
this.render = function()
|
||||
|
||||
@@ -2,6 +2,8 @@ function Bang()
|
||||
{
|
||||
Unit.call(this);
|
||||
|
||||
this.example = "";
|
||||
|
||||
this.render = function()
|
||||
{
|
||||
return "BANG";
|
||||
|
||||
@@ -2,6 +2,7 @@ function Color(hex = '#000000')
|
||||
{
|
||||
Unit.call(this);
|
||||
|
||||
this.example = "#ff0000";
|
||||
this.hex = hex;
|
||||
|
||||
this.rgb = function()
|
||||
|
||||
@@ -2,6 +2,7 @@ function Filepath(path_str)
|
||||
{
|
||||
Unit.call(this);
|
||||
|
||||
this.example = "assets/demo.png";
|
||||
this.path = path_str;
|
||||
|
||||
this.render = function()
|
||||
|
||||
@@ -2,6 +2,7 @@ function Position(position_str = "0,0",y = null)
|
||||
{
|
||||
Unit.call(this);
|
||||
|
||||
this.example = "100,150";
|
||||
this.position_str = position_str;
|
||||
|
||||
this.x = y ? position_str : parseFloat(this.position_str.split(",")[0]);
|
||||
|
||||
15
scripts/units/range.js
Normal file
15
scripts/units/range.js
Normal file
@@ -0,0 +1,15 @@
|
||||
function Range(range_str)
|
||||
{
|
||||
Unit.call(this);
|
||||
|
||||
this.example = "10..50";
|
||||
this.range_str = range_str;
|
||||
|
||||
this.from = parseFloat(this.range_str.split("..")[0]);
|
||||
this.to = parseFloat(this.range_str.split("..")[1]);
|
||||
|
||||
this.render = function()
|
||||
{
|
||||
return this.from+".."+this.to;
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@ function Rect(rect_str)
|
||||
{
|
||||
Unit.call(this);
|
||||
|
||||
this.example = "200x300";
|
||||
this.rect_str = rect_str;
|
||||
|
||||
this.width = rect_str ? parseFloat(this.rect_str.split("x")[0]) : 0;
|
||||
|
||||
@@ -2,6 +2,7 @@ function Value(value_str)
|
||||
{
|
||||
Unit.call(this);
|
||||
|
||||
this.example = "20";
|
||||
this.value = value_str;
|
||||
this.float = parseFloat(this.value);
|
||||
this.int = parseInt(this.value);
|
||||
|
||||
13
scripts/units/variable.js
Normal file
13
scripts/units/variable.js
Normal file
@@ -0,0 +1,13 @@
|
||||
function Variable(key,value)
|
||||
{
|
||||
Unit.call(this);
|
||||
|
||||
this.candidates = [];
|
||||
this.key = key;
|
||||
this.value = value;
|
||||
|
||||
this.render = function()
|
||||
{
|
||||
return this.key+"="+this.value;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user