Difference between revisions of "Qmaze2D How To/en/functions"

From QmazeWiki
Jump to: navigation, search
(setgamma)
 
(68 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[Qmaze2D_How_To/en|Back to the manual]]
+
[[Qmaze2D_How_To/en|''Back to the manual'']]
 
+
<br />
 +
=='''Explanation per individual function'''==
 +
<br />
 +
Here you can find all the documentation for each individual functions.<br />
 +
How to use the functions, what they do and more.<br />
 
<br /><br />
 
<br /><br />
 
+
If you wish to try out the functions in a safe and easy-to-use enviroment, visit: [https://diego.qmaze.nl/startquote?itemid=Manual_Demo''Demo'']
==3a. Explanation per individual function (Rules)==
 
 
<br />
 
<br />
===Adding / Altering (existing) objects / images:===
+
<br/><br/>
 
+
==='''Adding / altering (existent) objects / images:'''===
 +
These functions can be used to add objects / images to the canvas. <br />
 +
If objects already exist they will be altered.<br />
 
<br /><br />
 
<br /><br />
  
Line 15: Line 20:
 
Changes the default canvas to a fabric canvas.<br /><br />
 
Changes the default canvas to a fabric canvas.<br /><br />
 
Function structure:<br />
 
Function structure:<br />
x3d(object).setcanvas;<br /><br />
+
x3d(object).setcanvas;<br />
 +
setcanvas('object');<br />
 +
<br />
 
Example:<br />
 
Example:<br />
x3d(c).setcanvas;<br /><br />
+
x3d(c).setcanvas;<br />
 +
setcanvas('c');<br />
 +
The objects(id) must be the same as <br />
 +
<br />
 +
Returns:<br />
 +
canvas<br />
 +
 
  
 
<br /><br />
 
<br /><br />
Line 27: Line 40:
 
Adds a text object to a canvas or changes the text of an already existent text object.<br /><br />
 
Adds a text object to a canvas or changes the text of an already existent text object.<br /><br />
 
Function structure:<br />
 
Function structure:<br />
x3d(object).settext = value<br /><br />
+
x3d(object).settext = value<br />
 +
settext('object','value');<br />
 +
<br />
 
Example:<br />
 
Example:<br />
 
x3d(welcometext).settext = Hello World!<br />
 
x3d(welcometext).settext = Hello World!<br />
 +
settext('welcometext','Hello World!');<br />
 
In case a text object already exists; When the id matches that of an already existent text object,  
 
In case a text object already exists; When the id matches that of an already existent text object,  
 
the text of this object is then replaced by the given value.<br />
 
the text of this object is then replaced by the given value.<br />
 
If you wish to split a sentence (enter), you can use \n.<br />
 
If you wish to split a sentence (enter), you can use \n.<br />
An example of this: x3d('welcomeimg').settext = Hello \n World!<br />
+
An example of this: x3d('welcomeimg').settext = Hello \n World! or settext('welcomeimg','Hello \n World!');<br />
 +
<br />
 +
Returns:<br />
 +
add: object<br />
 +
alter: object or 'error'<br />
  
 
<br /><br />
 
<br /><br />
Line 45: Line 65:
 
Function structure:<br />
 
Function structure:<br />
 
x3d(object).setimage = source/url/data-string<br />
 
x3d(object).setimage = source/url/data-string<br />
 +
setimage('object','source/url/data-string);<br />
 
<br />
 
<br />
 
Example:<br />
 
Example:<br />
x3d(object).setimage = /Images/pug.png<br />
+
x3d('welcomeimg').setimage = /Images/pug.png<br />
 +
setimage('welcomeimg','/Images/pug.png');<br />
 
In case a image already exists; When the id matches that of an already existent image,
 
In case a image already exists; When the id matches that of an already existent image,
 
the source/url or datastring of this image will be replaced by the given value.<br />
 
the source/url or datastring of this image will be replaced by the given value.<br />
 +
supported: source/url/data/svg <br />
 +
<br />
 +
Returns:<br />
 +
add: object<br />
 +
alter: object or 'error'<br />
  
 
<br /><br />
 
<br /><br />
  
 
Function name:<br />
 
Function name:<br />
 +
 
===='''setbgimg'''====
 
===='''setbgimg'''====
 
<br /><br />
 
<br /><br />
Line 61: Line 89:
 
Function structure:<br />
 
Function structure:<br />
 
x3d(object).setbgimg = source/url/data-string<br />
 
x3d(object).setbgimg = source/url/data-string<br />
 +
setbgimg('object','source/url/data-string);<br />
 
<br />
 
<br />
 
Example:<br />
 
Example:<br />
x3d(object).setbgimg = /Images/pineapples.png<br />
+
x3d(bgimg).setbgimg = /Images/pineapples.png<br />
 +
setbgimg('bgimg','/Images/pineapples.png');<br />
 
In case a background image already exists; When the id matches that of an already existing background image,
 
In case a background image already exists; When the id matches that of an already existing background image,
 
the source/url or data string of this background image will be replaced by the given value.<br />
 
the source/url or data string of this background image will be replaced by the given value.<br />
 
When you add a background image with another id whilst a background image is already active on that canvas,  
 
When you add a background image with another id whilst a background image is already active on that canvas,  
 
the lastest added background image will be the one shown because of the layering structure. (see setz)<br />
 
the lastest added background image will be the one shown because of the layering structure. (see setz)<br />
 +
<br />
 +
Returns:<br />
 +
object <br />
  
 
<br /><br />
 
<br /><br />
Line 79: Line 112:
 
Function structure:<br />
 
Function structure:<br />
 
x3d(object).setrectangle = x1,y1,x2,y2<br />
 
x3d(object).setrectangle = x1,y1,x2,y2<br />
 +
setrectangle('object','x1,y1,x2,y2');<br />
 
<br />
 
<br />
 
Example:<br />
 
Example:<br />
 
x3d(newrect).setrectangle = 50,50,100,100<br />
 
x3d(newrect).setrectangle = 50,50,100,100<br />
 +
setrectangle('newrect','50,50,100,100');<br />
 
The rectangle in this example starts ( starting top left (0,0)) 50 pixels to the right and 50 pixels to the bottom.<br />
 
The rectangle in this example starts ( starting top left (0,0)) 50 pixels to the right and 50 pixels to the bottom.<br />
 
In case a rectangle with this id is already existent, the locations ( and the width,height ) are changed.<br />
 
In case a rectangle with this id is already existent, the locations ( and the width,height ) are changed.<br />
 +
<br />
 +
Returns:<br />
 +
add: object<br />
 +
alter: object or 'error'<br />
  
 
<br /><br />
 
<br /><br />
Line 95: Line 134:
 
Function structure:<br />
 
Function structure:<br />
 
x3d(object).setcircle = x,y,radius<br />
 
x3d(object).setcircle = x,y,radius<br />
 +
setcircle('object','x,y,radius');<br />
 
<br />
 
<br />
 
Example:<br />
 
Example:<br />
 
x3d(newcircle).setcircle = 50,50,25<br />
 
x3d(newcircle).setcircle = 50,50,25<br />
 +
setcircle('newcircle','50,50,25');<br />
 
The circle in this example starts ( starting top left (0,0)) 50 pixels to the right and 50 pixels to the bottom and gets a 25 pixel radius.<br />
 
The circle in this example starts ( starting top left (0,0)) 50 pixels to the right and 50 pixels to the bottom and gets a 25 pixel radius.<br />
 
In case a circle with this id is already existent, the location and radius is changed.<br />
 
In case a circle with this id is already existent, the location and radius is changed.<br />
 +
<br />
 +
Returns:<br />
 +
add: object<br />
 +
alter: object or 'error'<br />
  
 
<br /><br />
 
<br /><br />
Line 111: Line 156:
 
Function structure:<br />
 
Function structure:<br />
 
x3d(object).settriangle = x,y,width,height<br />
 
x3d(object).settriangle = x,y,width,height<br />
 +
settriangle('object','x,y,width,height');<br />
 
<br />
 
<br />
 
Example:<br />
 
Example:<br />
 
x3d(newtriangle).settriangle = 50,50,75,75<br />
 
x3d(newtriangle).settriangle = 50,50,75,75<br />
 +
settriangle('newtriangle','50,50,75,75');<br />
 
The triangle in this example starts ( starting top left (0,0)) 50 pixels to the right and 50 pixels to the bottom and get a 75 pixels height and a 75 pixels width.<br />
 
The triangle in this example starts ( starting top left (0,0)) 50 pixels to the right and 50 pixels to the bottom and get a 75 pixels height and a 75 pixels width.<br />
 
In case a triangle with this id is already existent, the location, height and width are changed.<br />
 
In case a triangle with this id is already existent, the location, height and width are changed.<br />
 +
<br />
 +
Returns:<br />
 +
add: object<br />
 +
alter: object or 'error'<br />
  
 
<br /><br />
 
<br /><br />
Line 121: Line 172:
 
Function name:<br />
 
Function name:<br />
 
===='''setpolygon'''====
 
===='''setpolygon'''====
<br />
+
<br /><br />
<br />
 
 
Function description:<br />
 
Function description:<br />
 
Adds a polygon to a canvas or changes an already existent polygon, the begin and endpoint always connect. ( positions)<br />
 
Adds a polygon to a canvas or changes an already existent polygon, the begin and endpoint always connect. ( positions)<br />
Line 128: Line 178:
 
Function structure:<br />
 
Function structure:<br />
 
x3d(object).setpolygon = x1,y1,x2,y2 etc.<br />
 
x3d(object).setpolygon = x1,y1,x2,y2 etc.<br />
 +
setpolygon('object','x1,y1,x2,y2 etc.');<br />
 
<br />
 
<br />
 
Example:<br />
 
Example:<br />
 
x3d(newpoly).setpolygon = 20,0,40,50,60,80,40,70,20,60<br />
 
x3d(newpoly).setpolygon = 20,0,40,50,60,80,40,70,20,60<br />
 +
setpolygon('newpoly','20,0,40,50,60,80,40,70,20,60');<br />
 
The polygon in this example starts ( starting top left (0,0)) 20 pixels to the right and 0 pixels to the bottom, the second point is 40 pixels to the right and 50 pixels to the bottom etc.<br />
 
The polygon in this example starts ( starting top left (0,0)) 20 pixels to the right and 0 pixels to the bottom, the second point is 40 pixels to the right and 50 pixels to the bottom etc.<br />
 
The end of the polygon always connects with the beginpoint.<br />
 
The end of the polygon always connects with the beginpoint.<br />
 
In case a triangle with this id is already existent, the points get changed.<br />
 
In case a triangle with this id is already existent, the points get changed.<br />
 +
<br />
 +
Returns:<br />
 +
add: object<br />
 +
alter: object or 'error'<br />
  
 
<br /><br />
 
<br /><br />
Line 139: Line 195:
 
Function name:<br />
 
Function name:<br />
 
===='''setarrows'''====
 
===='''setarrows'''====
<br />
+
<br /><br />
<br />
 
 
Function description:<br />
 
Function description:<br />
 
Adds a line to the canvas with 2 arrowpoints or replaces an already existing arrow/line.<br />
 
Adds a line to the canvas with 2 arrowpoints or replaces an already existing arrow/line.<br />
Line 146: Line 201:
 
Function structure:<br />
 
Function structure:<br />
 
x3d(object).setarrows = x1,y1,x2,y2<br />
 
x3d(object).setarrows = x1,y1,x2,y2<br />
 +
setarrows('object','x1,y1.x2.y2');<br />
 
<br />
 
<br />
 
Example:<br />
 
Example:<br />
 
x3d(newarrow).setarrows = 100,100,300,300<br />
 
x3d(newarrow).setarrows = 100,100,300,300<br />
 +
setarrows('newarrow','100,100,300,300');<br />
 
The arrow in this example starts ( starting top left (0,0)) 100 pixels to the right and 100 pixels to the bottom and stops 300 pixels to the right and 300 pixels to the bottom.<br />
 
The arrow in this example starts ( starting top left (0,0)) 100 pixels to the right and 100 pixels to the bottom and stops 300 pixels to the right and 300 pixels to the bottom.<br />
 
In case a arrow with this id is already existent (setline,setarrow,setarrows), the positions are replaced with the given value and if required arrowpoints are added/removed.<br />
 
In case a arrow with this id is already existent (setline,setarrow,setarrows), the positions are replaced with the given value and if required arrowpoints are added/removed.<br />
 +
<br />
 +
Returns:<br />
 +
object(s) or 'error'<br />
  
 
<br /><br />
 
<br /><br />
Line 156: Line 216:
 
Function name:<br />
 
Function name:<br />
 
===='''setarrow'''====
 
===='''setarrow'''====
<br />
+
<br /><br />
<br />
 
 
Function description:<br />
 
Function description:<br />
 
Adds a line to a canvas with 1 arrowpoint or replaces an already existing arrow/line.<br />
 
Adds a line to a canvas with 1 arrowpoint or replaces an already existing arrow/line.<br />
Line 163: Line 222:
 
Function structure:<br />
 
Function structure:<br />
 
x3d(object).setarrow = x1,y1,x2,y2<br />
 
x3d(object).setarrow = x1,y1,x2,y2<br />
 +
setarrow('object','x1,y1,x2,y2');<br />
 
<br />
 
<br />
 
Example:<br />
 
Example:<br />
x3d(object).setarrows = 100,100,300,300<br />
+
x3d(newarrow).setarrows = 100,100,300,300<br />
 +
setarrow('newarrow','100,100,300,300');
 
The arrow in this example starts ( starting top left (0,0)) 100 pixels to the right and 100 pixels to the bottom and stops 300 pixels to the right and 300 pixels to the bottom.<br />
 
The arrow in this example starts ( starting top left (0,0)) 100 pixels to the right and 100 pixels to the bottom and stops 300 pixels to the right and 300 pixels to the bottom.<br />
 
In case a arrow with this id is already existent (setline,setarrow,setarrows), the positions are replaced with the given value and if required arrowpoints are added/removed.<br />
 
In case a arrow with this id is already existent (setline,setarrow,setarrows), the positions are replaced with the given value and if required arrowpoints are added/removed.<br />
 +
<br />
 +
Returns:<br />
 +
object(s) or 'error'<br />
  
 
<br /><br />
 
<br /><br />
Line 173: Line 237:
 
Function name:<br />
 
Function name:<br />
 
===='''setline'''====
 
===='''setline'''====
<br />
+
<br /><br />
<br />
 
 
Function description:<br />
 
Function description:<br />
 
Adds a line to a canvas or replaces an already existing arrow/line.<br />
 
Adds a line to a canvas or replaces an already existing arrow/line.<br />
Line 180: Line 243:
 
Function structure:<br />
 
Function structure:<br />
 
x3d(object).setline = x1,y1,x2,y2<br />
 
x3d(object).setline = x1,y1,x2,y2<br />
 +
setline('object','x1,y1,x2,y2');
 
<br />
 
<br />
 
Example:<br />
 
Example:<br />
x3d(object).setline = 100,100,300,300<br />
+
x3d(newarrow).setline = 100,100,300,300<br />
 +
setline('newarrow','100,100,300,300');<br />
 
The arrow in this example starts ( starting top left (0,0)) 100 pixels to the right and 100 pixels to the bottom and stops 300 pixels to the right and 300 pixels to the bottom.<br />
 
The arrow in this example starts ( starting top left (0,0)) 100 pixels to the right and 100 pixels to the bottom and stops 300 pixels to the right and 300 pixels to the bottom.<br />
 
In case a arrow with this id is already existent (setline,setarrow,setarrows), the positions are replaced with the given value and if required arrowpoints are added/removed.<br />
 
In case a arrow with this id is already existent (setline,setarrow,setarrows), the positions are replaced with the given value and if required arrowpoints are added/removed.<br />
 +
<br />
 +
Returns:<br />
 +
object or 'error'<br />
  
 
<br /><br />
 
<br /><br />
  
===Altering existent objects / images===
+
==='''Altering existent objects / images'''===
 
+
These functions alter an already existent object' / image' property.
 
<br /><br />
 
<br /><br />
  
 
Function name: <br />
 
Function name: <br />
 
===='''setcolor'''====
 
===='''setcolor'''====
<br />
+
<br /><br />
<br />
 
 
Function description: <br />
 
Function description: <br />
 
Changes the color of an object.<br />
 
Changes the color of an object.<br />
Line 201: Line 268:
 
Function structure: <br />
 
Function structure: <br />
 
x3d(object).setcolor = value<br />
 
x3d(object).setcolor = value<br />
 +
setcolor('object','value');<br />
 
<br />
 
<br />
 
Example: <br />
 
Example: <br />
 
x3d(welcometext).setcolor = red<br />
 
x3d(welcometext).setcolor = red<br />
 +
setcolor('welcometext','red');<br />
 
When the object is a canvas the background color is changed to the given value.<br />
 
When the object is a canvas the background color is changed to the given value.<br />
+
The value can be a color in: string, hex and rgb.<br />
 +
<br />
 +
Returns:<br />
 +
object or 'error'<br />
 +
 
 
<br /><br />
 
<br /><br />
  
 
Function name: <br />
 
Function name: <br />
 
===='''setdraggable'''====
 
===='''setdraggable'''====
<br />
+
<br /><br />
<br />
 
 
Function description: <br />
 
Function description: <br />
 
Changes the object to be static or dynamic ( user interaction )<br />
 
Changes the object to be static or dynamic ( user interaction )<br />
Line 217: Line 289:
 
Function structure: <br />
 
Function structure: <br />
 
x3d(object).setdraggable = value<br />
 
x3d(object).setdraggable = value<br />
 +
setdraggable('object','value');<br />
 
<br />
 
<br />
 
Example: <br />
 
Example: <br />
 
x3d(welcomeimg).setdraggable = 1<br />
 
x3d(welcomeimg).setdraggable = 1<br />
 +
setdraggable('welcomeimg','1');<br />
 
The value can either be 1 or 0, where 0 makes the object static and 1 makes the object draggable.<br />
 
The value can either be 1 or 0, where 0 makes the object static and 1 makes the object draggable.<br />
 +
Objects that are NOT draggable will still have events, the user will not be able to move/scale/rotate the object/image.
 +
<br />
 +
Returns:<br />
 +
object or 'error'<br />
  
 
<br /><br />
 
<br /><br />
Line 226: Line 304:
 
Function name: <br />
 
Function name: <br />
 
===='''setanimationduration'''====
 
===='''setanimationduration'''====
<br />
+
<br /><br />
<br />
 
 
Function description: <br />
 
Function description: <br />
 
Changes the duration of animations.<br />
 
Changes the duration of animations.<br />
 
<br />
 
<br />
 
Function structure: <br />
 
Function structure: <br />
x3d(object).setanimationduration = duration<br />
+
x3d().setanimationduration = duration<br />
 +
setanimationduration('duration');<br />
 
<br />
 
<br />
 
Example: <br />
 
Example: <br />
 
x3d(object).setanimationduration = 1000<br />
 
x3d(object).setanimationduration = 1000<br />
 +
setanimationduration('1000');
 
In this example the animation duration is set to 1000ms (1 second).<br />
 
In this example the animation duration is set to 1000ms (1 second).<br />
The animation duration counts for all animations untill it is altered again.<br />
+
The animation duration counts for all animations until it is altered again.<br />
+
<br />
 +
Returns:<br />
 +
animation duration or 'error'<br />
  
 
<br /><br />
 
<br /><br />
Line 244: Line 325:
 
Function name: <br />
 
Function name: <br />
 
===='''setanimationtype'''====
 
===='''setanimationtype'''====
<br />
+
<br /><br />
<br />
+
Function description:<br />
Function description: <br />
 
 
Changes which animation is played when positions change.<br />
 
Changes which animation is played when positions change.<br />
 
<br />
 
<br />
 
Function structure: <br />
 
Function structure: <br />
x3d(object).setanimationtype = value<br />
+
x3d().setanimationtype = value<br />
 +
setanimationtype('value');<br />
 
<br />
 
<br />
 
Example: <br />
 
Example: <br />
x3d(object).setanimationtype = easeInOutBounce<br />
+
x3d().setanimationtype = easeInOutBounce<br />
 +
setanimationtype('easeInOutBounce');<br />
 
In this example the animation type is set to InOutBounce, this makes the object 'bounce' at the end of an position change.<br />
 
In this example the animation type is set to InOutBounce, this makes the object 'bounce' at the end of an position change.<br />
The animation type counts for all animations untill it is altered again.<br />
+
The animation type counts for all animations until it is altered again.<br />
+
<br />
 +
Returns:<br />
 +
animation name or 'error'<br />
  
 
<br /><br />
 
<br /><br />
Line 262: Line 346:
 
Function name: <br />
 
Function name: <br />
 
===='''sethandles'''====
 
===='''sethandles'''====
<br />
+
<br /><br />
<br />
 
 
Function description: <br />
 
Function description: <br />
 
Changes the handles of an object depended on the value.<br />
 
Changes the handles of an object depended on the value.<br />
Line 269: Line 352:
 
Function structure: <br />
 
Function structure: <br />
 
x3d(object).sethandles = value<br />
 
x3d(object).sethandles = value<br />
 +
sethandles('object','value');
 
<br />
 
<br />
 
Example: <br />
 
Example: <br />
x3d(newrect).sethandles = newrect<br />
+
x3d(newrect).sethandles = 2<br />
 +
sethandles('newrect','2');<br />
 
Changes which lines and or user interactive corners are visible.<br />
 
Changes which lines and or user interactive corners are visible.<br />
 +
<br />
 +
Returns:<br />
 +
object or 'error'<br />
  
 
<br /><br />
 
<br /><br />
Line 285: Line 373:
 
Function structure: <br />
 
Function structure: <br />
 
x3d(object).sethandlecolor = value<br />
 
x3d(object).sethandlecolor = value<br />
 +
sethandlecolor('object','value');<br />
 
<br />
 
<br />
 
Example: <br />
 
Example: <br />
 
x3d(newrect).sethandlecolor = red<br />
 
x3d(newrect).sethandlecolor = red<br />
 +
sethandlecolor('newrect','red');<br />
 +
This function changes the color of all handlers, visible or invisible.<br />
 +
The value can be a color in: string, hex and rgb.<br />
 +
<br />
 +
Returns:<br />
 +
object or 'error'<br />
  
 
<br /><br />
 
<br /><br />
Line 300: Line 395:
 
Function structure: <br />
 
Function structure: <br />
 
x3d(object).setheight = value<br />
 
x3d(object).setheight = value<br />
 +
setheight('object',value);<br />
 
<br />
 
<br />
 
Example: <br />
 
Example: <br />
 
x3d(welcomeimg).setheight = 150<br />
 
x3d(welcomeimg).setheight = 150<br />
+
setheight('welcomeimg',150);<br />
 +
<br />
 +
Returns:<br />
 +
object or 'error'<br />
 +
 
 
<br /><br />
 
<br /><br />
 
 
Line 315: Line 415:
 
Function structure: <br />
 
Function structure: <br />
 
x3d(object).setwidth = value<br />
 
x3d(object).setwidth = value<br />
 +
setwidth('object',value);<br />
 
<br />
 
<br />
 
Example: <br />
 
Example: <br />
 
x3d(welcomeimg).setwidth = 250<br />
 
x3d(welcomeimg).setwidth = 250<br />
+
setwidth('welcomeimg',250);<br />
 +
<br />
 +
Returns:<br />
 +
object or 'error'<br />
 +
 
<br /><br />
 
<br /><br />
 
 
Line 330: Line 435:
 
Function structure: <br />
 
Function structure: <br />
 
x3d(object).setscale = value<br />
 
x3d(object).setscale = value<br />
 +
setscale('object',value);<br />
 
<br />
 
<br />
 
Example: <br />
 
Example: <br />
 
x3d(welcomeimg).setscale = 0.8<br />
 
x3d(welcomeimg).setscale = 0.8<br />
 +
setscale('welcomeimg',0.8)<br />
 
The value represents the scale on which the object / image is scaled. ( x and y axle )<br />
 
The value represents the scale on which the object / image is scaled. ( x and y axle )<br />
 
The value 1 is the original value.<br />
 
The value 1 is the original value.<br />
+
<br />
 +
Returns:<br />
 +
object or 'error'<br />
 +
 
<br /><br />
 
<br /><br />
  
Line 347: Line 457:
 
Function structure: <br />
 
Function structure: <br />
 
x3d(object).setid = value<br />
 
x3d(object).setid = value<br />
 +
setid('object','value');<br />
 
<br />
 
<br />
 
Example: <br />
 
Example: <br />
 
x3d(welcomeimg).setid = goodbyeimg<br />
 
x3d(welcomeimg).setid = goodbyeimg<br />
The object is the id of an object that is to be changed, the value is to become the new id. The new id must not be existent on the canvas.<br />
+
setid('welcomeomg','goodbyeimg');<br />
 +
The object is the id of an object that is to be changed, the value is to become the new id. <br />
 +
The new id must not be existent on the canvas.<br />
 +
<br />
 +
Returns:<br />
 +
object or 'error'<br />
  
 
<br /><br />
 
<br /><br />
Line 363: Line 479:
 
Function structure: <br />
 
Function structure: <br />
 
x3d(object).setlineheight = value<br />
 
x3d(object).setlineheight = value<br />
 +
setlineheight('object',value);<br />
 
<br />
 
<br />
 
Example:
 
Example:
 
x3d(welcometext).setlineheight = 10
 
x3d(welcometext).setlineheight = 10
+
setlineheight('welcometext',10);<br />
 +
<br />
 +
Returns:<br />
 +
object or 'error'<br />
 +
 
<br /><br />
 
<br /><br />
 
 
Line 378: Line 499:
 
Function structure: <br />
 
Function structure: <br />
 
x3d(object).setrotation = value<br />
 
x3d(object).setrotation = value<br />
 +
setrotation('object',value);<br />
 
<br />
 
<br />
 
Example: <br />
 
Example: <br />
 
x3d(welcomeimg).setrotation = 90<br />
 
x3d(welcomeimg).setrotation = 90<br />
 +
setrotation('welcomeimg',90);<br />
 
The value is the rotation starting from the original rotationpoint (0) in degrees. (celcius)<br />
 
The value is the rotation starting from the original rotationpoint (0) in degrees. (celcius)<br />
+
The object / image is always rotated from its most center point. <br />
 +
This function is animated if an animation is set.<br />
 +
<br />
 +
Returns:<br />
 +
object or 'error'<br />
 +
 
 
<br /><br />
 
<br /><br />
 
 
Line 394: Line 522:
 
Function structure: <br />
 
Function structure: <br />
 
x3d(object).setx = value<br />
 
x3d(object).setx = value<br />
 +
setx('object',value);<br />
 
<br />
 
<br />
 
Example: <br />
 
Example: <br />
 
x3d(welcomeimg).setx = 500<br />
 
x3d(welcomeimg).setx = 500<br />
 +
setx('welcomeimg',500);<br />
 
The image in this example will now be placed 500 pixels to the right.<br />
 
The image in this example will now be placed 500 pixels to the right.<br />
+
This function can be animated dependend on the animationtype and duration.<br />
 +
Using the setx and sety function together will make the object / image move diagonally. <br />
 +
This function is animated if an animation is set.<br />
 +
<br />
 +
Returns:<br />
 +
object or 'error'<br />
 +
 
 
<br /><br />
 
<br /><br />
 
 
Line 410: Line 546:
 
Function structure: <br />
 
Function structure: <br />
 
x3d(object).sety = value<br />
 
x3d(object).sety = value<br />
 +
sety('object',value);<br />
 
<br />
 
<br />
 
Example: <br />
 
Example: <br />
 
x3d(welcomeimg).sety = 200<br />
 
x3d(welcomeimg).sety = 200<br />
 +
sety('welcomeimg',200);<br />
 
The image in this example will now be placed 200 pixels to the bottom.<br />
 
The image in this example will now be placed 200 pixels to the bottom.<br />
+
This function can be animated dependend on the animationtype and duration.<br />
 +
Using the setx and sety function together will make the object / image move diagonally. <br />
 +
This function is animated if an animation is set.<br />
 +
<br />
 +
Returns:<br />
 +
object or 'error'<br />
 +
 
 
<br /><br />
 
<br /><br />
 
 
Line 426: Line 570:
 
Function structure: <br />
 
Function structure: <br />
 
x3d(object).setz = value<br />
 
x3d(object).setz = value<br />
 +
setz('object',value);<br />
 
<br />
 
<br />
 
Example: <br />
 
Example: <br />
 
x3d(welcomeimg).setz = 10<br />
 
x3d(welcomeimg).setz = 10<br />
 +
setz('welcomeimg',10);<br />
 
The value is the layer on which the object / image is placed, where the layer 0 is in the back.<br />
 
The value is the layer on which the object / image is placed, where the layer 0 is in the back.<br />
 
The object / image that is already active on the chosen layer will be placed 1 place higher into the layers.<br />
 
The object / image that is already active on the chosen layer will be placed 1 place higher into the layers.<br />
 +
<br />
 +
Returns:<br />
 +
object or 'error'<br />
  
 
<br /><br />
 
<br /><br />
Line 443: Line 592:
 
Function structure: <br />
 
Function structure: <br />
 
x3d(object).setstroke = value<br />
 
x3d(object).setstroke = value<br />
 +
setstroke('object',value);<br />
 
<br />
 
<br />
 
Example: <br />
 
Example: <br />
 
x3d(newrect).setstroke = 20<br />
 
x3d(newrect).setstroke = 20<br />
 +
setstroke('newrect',20);<br />
 
The object gets a line around the object with the size of the value in pixels.<br />
 
The object gets a line around the object with the size of the value in pixels.<br />
+
<br />
 +
Returns:<br />
 +
object or 'error'<br />
 +
 
 
<br /><br />
 
<br /><br />
 
 
Line 459: Line 613:
 
Function structure: <br />
 
Function structure: <br />
 
x3d(object).setstrokecolor = value<br />
 
x3d(object).setstrokecolor = value<br />
 +
setstrokecolor('object','value');<br />
 
<br />
 
<br />
 
Example: <br />
 
Example: <br />
 
x3d(newrect).setstrokecolor = blue<br />
 
x3d(newrect).setstrokecolor = blue<br />
+
setstrokecolor('newrect','blue');<br />
 +
The value can be a color in: string, hex and rgb.<br />
 +
<br />
 +
Returns:<br />
 +
object or 'error'<br />
 +
 
<br /><br />
 
<br /><br />
 
 
Line 474: Line 634:
 
Function structure: <br />
 
Function structure: <br />
 
x3d(object).settextfont = value<br />
 
x3d(object).settextfont = value<br />
 +
settextfont('object','value');<br />
 
<br />
 
<br />
 
Example: <br />
 
Example: <br />
 
x3d(welcometext).settextfont = Arial<br />
 
x3d(welcometext).settextfont = Arial<br />
 +
settextfont('welcometext','Arial');<br />
 
The text font must exist, if this is not the case the text font will remain the same. Attention: Case sensitive!<br />
 
The text font must exist, if this is not the case the text font will remain the same. Attention: Case sensitive!<br />
 
You can download text fonts directly from fonts.google.com or through a url link.<br />
 
You can download text fonts directly from fonts.google.com or through a url link.<br />
+
<br />
 +
Returns:<br />
 +
object or 'error'<br />
 +
 
 
<br /><br />
 
<br /><br />
 
 
Line 491: Line 656:
 
Function structure: <br />
 
Function structure: <br />
 
x3d(object).settextsize = value<br />
 
x3d(object).settextsize = value<br />
 +
settextsize('object',value);<br />
 
<br />
 
<br />
 
Example: <br />
 
Example: <br />
 
x3d(welcometext).settextsize = 20<br />
 
x3d(welcometext).settextsize = 20<br />
 +
settextsize('welcometext',20);<br />
 
The value is the text size in pixels.<br />
 
The value is the text size in pixels.<br />
+
<br />
 +
Returns:<br />
 +
object or 'error'<br />
 +
 
 
<br /><br />
 
<br /><br />
 
 
Line 507: Line 677:
 
Function structure: <br />
 
Function structure: <br />
 
x3d(object).settextweight = value<br />
 
x3d(object).settextweight = value<br />
 +
settextweight('object',value);<br />
 
<br />
 
<br />
 
Example: <br />
 
Example: <br />
 
x3d(welcometext).settextweight = 400<br />
 
x3d(welcometext).settextweight = 400<br />
 +
settextweight('welcometext',400);<br />
 
Possible values: light, normal, bold, number.<br />
 
Possible values: light, normal, bold, number.<br />
+
<br />
 +
Returns:<br />
 +
object or 'error'<br />
 +
 
 
<br /><br />
 
<br /><br />
 
 
Line 523: Line 698:
 
Function structure: <br />
 
Function structure: <br />
 
x3d(object).setvisible = value<br />
 
x3d(object).setvisible = value<br />
 +
setvisible('object',value);<br />
 
<br />
 
<br />
 
Example: <br />
 
Example: <br />
 
x3d(welcometext).setvisible = 0.7<br />
 
x3d(welcometext).setvisible = 0.7<br />
 +
setvisible('welcometext',0.7);<br />
 
To make the canvas visible or invisible the value must be either 1 or 0 where 0 makes it invisible and 1 makes it visible.<br />
 
To make the canvas visible or invisible the value must be either 1 or 0 where 0 makes it invisible and 1 makes it visible.<br />
 
To make an object / image visible or invisible the value must be between 0 and 1, where 1 is visible and 0 is invisible, decimals may be used.<br />
 
To make an object / image visible or invisible the value must be between 0 and 1, where 1 is visible and 0 is invisible, decimals may be used.<br />
 +
This function is animated if an animation is set.<br />
 +
<br />
 +
Returns:<br />
 +
object or 'error'<br />
  
 
<br /><br />
 
<br /><br />
Line 540: Line 721:
 
Function structure: <br />
 
Function structure: <br />
 
x3d(object).setflipx = value<br />
 
x3d(object).setflipx = value<br />
 +
setflipx('object','value');
 
<br />
 
<br />
 
Example: <br />
 
Example: <br />
 
x3d(welcomeimg).setflipx = true<br />
 
x3d(welcomeimg).setflipx = true<br />
 +
setflipx('welcomeimg','true');<br />
 
The 'value' true flips the object / image around from it original stance, the value 'false' changes it back to it's original stance.<br />
 
The 'value' true flips the object / image around from it original stance, the value 'false' changes it back to it's original stance.<br />
 
The value 'flip' makes the object / image flip around no matter which stance it currently is.<br />
 
The value 'flip' makes the object / image flip around no matter which stance it currently is.<br />
+
<br />
 +
Returns:<br />
 +
object or 'error'<br />
 +
 
 
<br /><br />
 
<br /><br />
  
Line 557: Line 743:
 
Function structure: <br />
 
Function structure: <br />
 
x3d(object).setflipy = value<br />
 
x3d(object).setflipy = value<br />
 +
setflipy('object','value');<br />
 
<br />
 
<br />
 
Example: <br />
 
Example: <br />
 
x3d(welcomeimg).setflipy = flip<br />
 
x3d(welcomeimg).setflipy = flip<br />
 +
setflipy('welcomeimg','flip');<br />
 
The 'value' true flips the object / image around from it original stance, the value 'false' changes it back to it's original stance.<br />
 
The 'value' true flips the object / image around from it original stance, the value 'false' changes it back to it's original stance.<br />
 
The value 'flip' makes the object / image flip around no matter which stance it currently is.<br />
 
The value 'flip' makes the object / image flip around no matter which stance it currently is.<br />
+
<br />
 +
Returns:<br />
 +
object or 'error'<br />
 +
 
<br /><br />
 
<br /><br />
  
Line 574: Line 765:
 
Function structure: <br />
 
Function structure: <br />
 
x3d(object).setdefault = property,propertyvalue<br />
 
x3d(object).setdefault = property,propertyvalue<br />
 +
setdefault('object','propertympropertyvalue');
 
<br />
 
<br />
 
Example: <br />
 
Example: <br />
 
x3d(text).setdefault = fill,red<br />
 
x3d(text).setdefault = fill,red<br />
 
+
setdefault('text','fill,red');<br />
<br /><br />
+
Object defines the type of object, this could for example be; 'Text','Image','Rectangle','Arrow','Circle',Etc.<br />
 
+
Neither the property, nor the propertyvalue is case sensitive.<br />
===Retrieving object / imag properties===
+
<br />
 +
Returns:<br />
 +
default properties or 'error'<br />
  
 
<br /><br />
 
<br /><br />
  
 
Function name: <br />
 
Function name: <br />
===='''getproperty'''====
+
===='''setcornersize'''====
 
<br />
 
<br />
 
<br />
 
<br />
 
Function description: <br />
 
Function description: <br />
Gets the chosen property (value) of the object / image.<br />
+
Changes the size of the handle corners.<br />
 
<br />
 
<br />
 
Function structure: <br />
 
Function structure: <br />
x3d(object).getproperty = value<br />
+
x3d(object).setcornersize = value<br />
 +
setcornersize('object','value');
 
<br />
 
<br />
 
Example: <br />
 
Example: <br />
x3d(welcomeimg).getproperty = top<br />
+
x3d(welcomeimg).setcornersize = 8<br />
The value is the property you wish to retrieve.<br />
+
setcornersize('welcomeimg',8);<br />
+
<br />
<br /><br />
+
Returns:<br />
 +
object or 'error'<br />
  
Function name: <br />
 
===='''getx'''====
 
<br />
 
<br />
 
Function description: <br />
 
Gets the x-axle value from the object / image.<br />
 
<br />
 
Function structure: <br />
 
x3d(object).getx<br />
 
<br />
 
Example: <br />
 
x3d(welcomeimg).getx<br />
 
 
 
<br /><br />
 
<br /><br />
 
Function name: <br />
 
===='''gety'''====
 
<br />
 
<br />
 
Function description: <br />
 
Gets the y-axle value from the object / image.<br />
 
<br />
 
Function structure: <br />
 
x3d(object).gety<br />
 
<br />
 
Example: <br />
 
x3d(welcomeimg).gety<br />
 
 
<br /><br />
 
  
 
Function name: <br />
 
Function name: <br />
===='''getz'''====
+
===='''setcornercolor'''====
 
<br />
 
<br />
 
<br />
 
<br />
 
Function description: <br />
 
Function description: <br />
Gets the layer on which the object / images resides.<br />
+
Changes the color of the handle corners.<br />
 
<br />
 
<br />
 
Function structure: <br />
 
Function structure: <br />
x3d(object).getz<br />
+
x3d(object).setcornercolor = value<br />
 +
setcornercolor('object','value');
 
<br />
 
<br />
 
Example: <br />
 
Example: <br />
x3d(welcomeimg).getz<br />
+
x3d(welcomeimg).setcornercolor = Red<br />
+
setcornercolor('welcomeimg','Red');<br />
<br /><br />
 
 
Function name: <br />
 
===='''getscale'''====
 
 
<br />
 
<br />
<br />
+
Returns:<br />
Function description: <br />
+
object or 'error'<br />
Gets the objects scale (X&Y combined)<br />
+
 
<br />
 
Function structure: <br />
 
x3d(object).getscale<br />
 
<br />
 
Example: <br />
 
x3d(welcomeimg).getscale<br />
 
 
 
<br /><br />
 
<br /><br />
+
 
 
Function name: <br />
 
Function name: <br />
===='''getscalex'''====
+
===='''setbordercolor'''====
 
<br />
 
<br />
 
<br />
 
<br />
 
Function description: <br />
 
Function description: <br />
Gets the objects x-axle scale.<br />
+
Changes the color of the handle line.<br />
 
<br />
 
<br />
 
Function structure: <br />
 
Function structure: <br />
x3d(object).getscalex<br />
+
x3d(object).setbordercolor = value<br />
 +
setbordercolor('object','value');
 
<br />
 
<br />
Example: <br />
+
Example: <br />
x3d(welcomeimg).getscalex<br />
+
x3d(welcomeimg).setbordercolor = Red<br />
+
setbordercolor('welcomeimg','Red');<br />
<br /><br />
 
 
Function name: <br />
 
===='''getscaley'''====
 
 
<br />
 
<br />
<br />
+
Returns:<br />
Function description: <br />
+
object or 'error'<br />
Gets the objects y-axle scale.<br />
 
<br />
 
Function structure: <br />
 
x3d(object).getscalex<br />
 
<br />
 
Example: <br />
 
x3d(welcomeimg).getscalex<br />
 
 
 
<br /><br />
 
 
 
===Other functions===
 
  
 
<br /><br />
 
<br /><br />
  
 
Function name: <br />
 
Function name: <br />
===='''copy'''====
+
===='''settransparentcorners'''====
 
<br />
 
<br />
 
<br />
 
<br />
 
Function description: <br />
 
Function description: <br />
Copies the chosen object / image and gives it a new id.<br />
+
Changes the transparancy of the handle corners.<br />
 
<br />
 
<br />
 
Function structure: <br />
 
Function structure: <br />
x3d(object).copy = value<br />
+
x3d(object).settransparentborders = value<br />
 +
settransparentborders('object','value');
 
<br />
 
<br />
 
Example: <br />
 
Example: <br />
x3d(welcomeimg).copy = newimage<br />
+
x3d(welcomeimg).settransparentborders = true<br />
The new id (value) must be unique. (can't already exist)<br />
+
settransparentborders('welcomeimg',true);<br />
 
<br /><br />
 
 
Function name: <br />
 
===='''delete'''====
 
<br />
 
<br />
 
Function description: <br />
 
Deletes the chosen object / image from the canvas.<br />
 
<br />
 
Function structure: <br />
 
x3d(object).delete<br />
 
 
<br />
 
<br />
Example: <br />
+
Returns:<br />
x3d(newimage).delete<br />
+
object or 'error'<br />
To use this function, you only need to enter a object(id).<br />
 
 
 
  
<br /><br />
 
 
Function name: <br />
 
===='''clearcanvas'''====
 
<br />
 
<br />
 
Function description: <br />
 
Removes all objects and images from the canvas.<br />
 
<br />
 
Function structure: <br />
 
x3d(object).clearcanvas<br />
 
<br />
 
Example: <br />
 
x3d(c).clearcanvas<br />
 
To use this function, you only need to enter a object(id).<br />
 
The object(id) in this case is that of the canvas.<br />
 
 
 
<br /><br />
 
<br /><br />
  
 
Function name: <br />
 
Function name: <br />
===='''screenshot'''====
+
===='''setgroup'''====
 
<br />
 
<br />
 
<br />
 
<br />
 
Function description: <br />
 
Function description: <br />
Makes a screenshot of the chosen canvas.<br />
+
Wraps a fabric group element around one or more object(s).<br />
 
<br />
 
<br />
 
Function structure: <br />
 
Function structure: <br />
x3d(object).screenshot<br />
+
x3d(group).setgroup = object(s)<br />
 +
setgroup('group','object(s)');
 
<br />
 
<br />
Example: <br />
+
Example: <br />
x3d(c).screenshot<br />
+
x3d(welcomegroup).setgroup = welcometext, welcomeimg, welcomesign<br />
To use this function, you only need to enter a object(id).<br />
+
setgroup('welcomegroup','welcometext,welcomeimg,welcomesign');<br />
The object(id) in this case is that of the canvas.<br />
 
 
 
<br /><br />
 
 
 
==3b. Explanation per individual function (Outputscript)==
 
<br />
 
===Adding / Altering (existing) objects / images:===
 
 
 
<br /><br />
 
 
 
Function name:<br />
 
'''setcanvas'''<br /><br />
 
Function description:<br />
 
Changes the default canvas to a fabric canvas.<br /><br />
 
Function structure:<br />
 
setcanvas('object');<br /><br />
 
Example:<br />
 
setcanvas('c');<br /><br />
 
 
 
<br /><br />
 
 
 
Function name:<br />
 
'''settext'''<br /><br />
 
Function description:<br />
 
Adds a text object to a canvas or changes the text of an already existent text object.<br /><br />
 
Function structure:<br />
 
settext ('object','value');<br /><br />
 
Example:<br />
 
settext('welcometext','Hello World!');<br />
 
In case a text object already exists; When the id matches that of an already existent text object,
 
the text of this object is then replaced by the given value.<br />
 
If you wish to split a sentence (enter), you can use \n.<br />
 
An example of this: x3d('welcomeimg').settext = Hello \n World!<br />
 
 
 
<br /><br />
 
 
 
Function name:<br />
 
'''setimage'''<br />
 
<br />
 
Function description:<br />
 
Adds a image to a canvas or changes the source/url or data string of an already existent image.<br />
 
<br />
 
Function structure:<br />
 
setimage('object ','source/url/data-string');<br />
 
<br />
 
Example:<br />
 
setimage('welcomeimg','/Images/pug.png');<br />
 
In case a image already exists; When the id matches that of an already existent image,
 
the source/url or datastring of this image will be replaced by the given value.<br />
 
 
 
<br /><br />
 
 
 
Function name:<br />
 
'''setbgimg'''<br />
 
<br />
 
Function description:<br />
 
Adds a background image to a canvas or changes the current background image, the image fills the entire canvas.<br />
 
<br />
 
Function structure:<br />
 
setbgimg('object','source/url/data-string');<br />
 
<br />
 
Example:<br />
 
setbgimg('bgimg','/Images/pineapples.png');<br />
 
In case a background image already exists; When the id matches that of an already existing background image,
 
the source/url or data string of this background image will be replaced by the given value.<br />
 
When you add a background image with another id whilst a background image is already active on that canvas,
 
the lastest added background image will be the one shown because of the layering structure. (see setz)<br />
 
 
 
<br /><br />
 
 
 
Function name:<br />
 
'''setrectangle'''<br />
 
<br />
 
Function description:<br />
 
Adds a rectangle to a canvas or changes an already existent rectangle. ( position, height and width )<br />
 
<br />
 
Function structure:<br />
 
setrectangle('object','x1,y1,x2,y2');<br />
 
<br />
 
Example:<br />
 
setrectangle('newrect' , '50,50,100,100');<br />
 
The rectangle in this example starts ( starting top left (0,0)) 50 pixels to the right and 50 pixels to the bottom.<br />
 
In case a rectangle with this id is already existent, the locations ( and the width,height ) are changed.<br />
 
 
 
<br /><br />
 
 
 
Function name:<br />
 
'''setcircle'''<br />
 
<br />
 
Function description:<br />
 
Adds a circle to a canvas or changes an already existent circle. ( position and radius )<br />
 
<br />
 
Function structure:<br />
 
setcircle('object','x,y,radius');<br />
 
<br />
 
Example:<br />
 
setcircle('newcircle','50,50,25');<br />
 
The circle in this example starts ( starting top left (0,0)) 50 pixels to the right and 50 pixels to the bottom and gets a 25 pixel radius.<br />
 
In case a circle with this id is already existent, the location and radius is changed.<br />
 
 
 
<br /><br />
 
 
 
Function name:<br />
 
'''settriangle'''<br />
 
<br />
 
Function description:<br />
 
Adds a triangle to a canvas or changes an already existent circle. ( position, height and width )<br />
 
<br />
 
Function structure:<br />
 
settriangle ('object','x,y,width,height');<br />
 
<br />
 
Example:<br />
 
settriangle('newtriangle',50,50,75,75');<br />
 
The triangle in this example starts ( starting top left (0,0)) 50 pixels to the right and 50 pixels to the bottom and get a 75 pixels height and a 75 pixels width.<br />
 
In case a triangle with this id is already existent, the location, height and width are changed.<br />
 
 
 
<br /><br />
 
 
 
Function name:<br />
 
'''setpolygon'''<br />
 
<br />
 
Function description:<br />
 
Adds a polygon to a canvas or changes an already existent polygon, the begin and endpoint always connect. ( positions)<br />
 
<br />
 
Function structure:<br />
 
setpolygon('object','x1,y1,x2,y2 etc.');<br />
 
<br />
 
Example:<br />
 
setpolygon('newpoly','20,0,40,50,60,80,40,70,20,60');<br />
 
The polygon in this example starts ( starting top left (0,0)) 20 pixels to the right and 0 pixels to the bottom, the second point is 40 pixels to the right and 50 pixels to the bottom etc.<br />
 
The end of the polygon always connects with the beginpoint.<br />
 
In case a triangle with this id is already existent, the points get changed.<br />
 
 
 
<br /><br />
 
 
 
Function name:<br />
 
'''setarrows'''<br />
 
<br />
 
Function description:<br />
 
Adds a line to the canvas with 2 arrowpoints or replaces an already existing arrow/line.<br />
 
<br />
 
Function structure:<br />
 
setarrows('object','x1,y1,x2,y2');<br />
 
<br />
 
Example:<br />
 
setarrows('newarrow','100,100,300,300');<br />
 
The arrow in this example starts ( starting top left (0,0)) 100 pixels to the right and 100 pixels to the bottom and stops 300 pixels to the right and 300 pixels to the bottom.<br />
 
In case a arrow with this id is already existent (setline,setarrow,setarrows), the positions are replaced with the given value and if required arrowpoints are added/removed.<br />
 
 
 
<br /><br />
 
 
 
Function name:<br />
 
'''setarrow'''<br />
 
<br />
 
Function description:<br />
 
Adds a line to a canvas with 1 arrowpoint or replaces an already existing arrow/line.<br />
 
<br />
 
Function structure:<br />
 
setarrow('object','x1,y1,x2,y2');<br />
 
 
<br />
 
<br />
Example:<br />
+
Returns:<br />
setarrows('newdbarrow','100,100,300,300');<br />
+
group or 'error'<br />
The arrow in this example starts ( starting top left (0,0)) 100 pixels to the right and 100 pixels to the bottom and stops 300 pixels to the right and 300 pixels to the bottom.<br />
 
In case a arrow with this id is already existent (setline,setarrow,setarrows), the positions are replaced with the given value and if required arrowpoints are added/removed.<br />
 
 
 
<br /><br />
 
 
 
Function name:<br />
 
'''setline'''<br />
 
<br />
 
Function description:<br />
 
Adds a line to a canvas or replaces an already existing arrow/line.<br />
 
<br />
 
Function structure:<br />
 
setline('object','x1,y1,x2,y2');<br />
 
<br />
 
Example:<br />
 
setline('newline','100,100,300,300');<br />
 
The arrow in this example starts ( starting top left (0,0)) 100 pixels to the right and 100 pixels to the bottom and stops 300 pixels to the right and 300 pixels to the bottom.<br />
 
In case a arrow with this id is already existent (setline,setarrow,setarrows), the positions are replaced with the given value and if required arrowpoints are added/removed.<br />
 
 
 
<br /><br />
 
 
 
===Altering existent objects / images===
 
  
 
<br /><br />
 
<br /><br />
  
 
Function name: <br />
 
Function name: <br />
'''setcolor'''<br />
+
===='''settextpattern'''====
<br />
 
Function description: <br />
 
Changes the color of an object.<br />
 
 
<br />
 
<br />
Function structure: <br />
 
setcolor('object','value');<br />
 
<br />
 
Example: <br />
 
setcolor('welcometext','red');<br />
 
When the object is a canvas the background color is changed to the given value.<br />
 
 
<br /><br />
 
 
Function name: <br />
 
'''setdraggable'''<br />
 
 
<br />
 
<br />
 
Function description: <br />
 
Function description: <br />
Changes the object to be static or dynamic ( user interaction )<br />
+
Lays a (image) pattern over a text object. <br />
 
<br />
 
<br />
 
Function structure: <br />
 
Function structure: <br />
setdraggable('object',value);<br />
+
x3d(object).settextpattern = src/url<br />
 +
settextpattern('object','src/url');
 
<br />
 
<br />
Example: <br />
+
Example: <br />
setdraggable('object',1);<br />
+
x3d(welcometext).settextpattern = Images/pineapples.png<br />
The value can either be 1 or 0, where 0 makes the object static and 1 makes the object draggable.<br />
+
settextpattern('welcometext','Images/pineapples.png');<br />
 
 
<br /><br />
 
 
 
Function name: <br />
 
'''setanimationduration'''<br />
 
<br />
 
Function description: <br />
 
Changes the duration of animations.<br />
 
<br />
 
Function structure: <br />
 
setanimationduration(duration);<br />
 
 
<br />
 
<br />
Example: <br />
+
Returns:<br />
setanimationduration(1000);<br />
+
object or 'error'<br />
In this example the animation duration is set to 1000ms (1 second).<br />
 
The animation duration counts for all animations untill it is altered again.<br />
 
 
  
 
<br /><br />
 
<br /><br />
  
 
Function name: <br />
 
Function name: <br />
'''setanimationtype'''<br />
+
===='''ungroup'''====
 
<br />
 
<br />
Function description: <br />
 
Changes which animation is played when positions change.<br />
 
 
<br />
 
<br />
Function structure: <br />
+
Function description: <br />
setanimationtype('value');<br />
+
Removes an already existent group from the canvas. <br />
<br />
 
Example: <br />
 
setanimationtype('easeInOutBounce');<br />
 
In this example the animation type is set to InOutBounce, this makes the object 'bounce' at the end of an position change.<br />
 
The animation type counts for all animations untill it is altered again.<br />
 
 
 
 
<br /><br />
 
 
 
Function name: <br />
 
'''sethandles'''<br />
 
<br />
 
Function description: <br />
 
Changes the handles of an object depended on the value.<br />
 
 
<br />
 
<br />
 
Function structure: <br />
 
Function structure: <br />
sethandles('object',value);<br />
+
x3d(group).ungroup = value<br />
 +
ungroup('group','value');
 
<br />
 
<br />
 
Example: <br />
 
Example: <br />
sethandles('newrect',1);<br />
+
x3d(welcomegroup).ungroup = 1<br />
Changes which lines and or user interactive corners are visible.<br />
+
ungroup('welcomegroup',1);<br />
 
 
<br /><br />
 
 
 
Function name: <br />
 
'''sethandlecolor'''<br />
 
<br />
 
Function description: <br />
 
Changes the color of the handles.<br />
 
<br />
 
Function structure: <br />
 
sethandlecolor('object','value');<br />
 
 
<br />
 
<br />
Example: <br />
+
Returns:<br />
sethandlecolor('newrect','red');<br />
+
group or 'error'<br />
  
 
<br /><br />
 
<br /><br />
  
 
Function name: <br />
 
Function name: <br />
'''setheight'''<br />
+
===='''setdraganddrop'''====
<br />
 
Function description: <br />
 
Changes the height of an object in pixels.<br />
 
<br />
 
Function structure: <br />
 
setheight('object',value);<br />
 
 
<br />
 
<br />
Example: <br />
 
setheight('welcomeimg',150);<br />
 
 
<br /><br />
 
 
Function name: <br />
 
'''setwidth'''<br />
 
 
<br />
 
<br />
 
Function description: <br />
 
Function description: <br />
Changes the width of an object in pixels.<br />
+
Enables/disables html image drag and drop onto the canvas. <br />
 
<br />
 
<br />
 
Function structure: <br />
 
Function structure: <br />
setwidth('object',value);<br />
+
x3d().setdraganddrop = value<br />
<br />
+
setdraganddrop('','value');
Example: <br />
 
setwidth('welcomeimg',250);<br />
 
 
<br /><br />
 
 
Function name: <br />
 
'''setscale'''<br />
 
<br />
 
Function description: <br />
 
Changes the width and height of an object or image by scale.<br />
 
<br />
 
Function structure: <br />
 
setscale('object',value);<br />
 
 
<br />
 
<br />
 
Example: <br />
 
Example: <br />
setscale('welcomeimg',0.8);<br />
+
x3d().setdraganddrop = true <br />
The value represents the scale on which the object / image is scaled. ( x and y axle )<br />
+
setdraganddrop('',true);<br />
The value 1 is the original value.<br />
+
Only images with the property: " draggable = 'true' " are draggable onto the canvas.<br />
 
<br /><br />
 
 
 
Function name: <br />
 
'''setid'''<br />
 
 
<br />
 
<br />
Function description: <br />
+
Returns:<br />
Changes the id of an already existent object / image.<br />
+
draggable images or 'error'<br />
<br />
 
Function structure: <br />
 
setid('object','value');<br />
 
<br />
 
Example: <br />
 
setid('welcomeimg','goodbyeimg');<br />
 
The object is the id of an object that is to be changed, the value is to become the new id. The new id must not be existent on the canvas.<br />
 
  
 
<br /><br />
 
<br /><br />
  
Function name: <br />
 
'''setlineheight'''<br />
 
<br />
 
Function description: <br />
 
Changes how much height is between text lines.<br />
 
<br />
 
Function structure: <br />
 
setlineheight('object',value);<br />
 
<br />
 
Example:<br />
 
setlineheight('welcometext',10);<br />
 
 
<br /><br />
 
 
Function name: <br />
 
'''setrotation'''<br />
 
<br />
 
Function description: <br />
 
Changes the rotation of an object / image.<br />
 
<br />
 
Function structure: <br />
 
setrotation('object',value);<br />
 
<br />
 
Example: <br />
 
setrotation('welcomeimg',90);<br />
 
The value is the rotation starting from the original rotationpoint (0) in degrees. (celcius)<br />
 
 
<br /><br />
 
 
 
Function name: <br />
 
Function name: <br />
'''setx'''<br />
+
===='''sethue'''====
 
<br />
 
<br />
Function description: <br />
 
Changes the position of an object / image on the x-axle. (in pixels where the left is 0)<br />
 
<br />
 
Function structure: <br />
 
setx('object',value);<br />
 
<br />
 
Example: <br />
 
setx('welcomeimg',500);<br />
 
The image in this example will now be placed 500 pixels to the right.<br />
 
 
<br /><br />
 
 
Function name: <br />
 
'''sety'''<br />
 
 
<br />
 
<br />
 
Function description: <br />
 
Function description: <br />
Changes the position of an object / image on the y-axle. (in pixels where the top is 0)<br />
+
Places a filter above an object / image that changes its hue vibrance.<br />
 
<br />
 
<br />
 
Function structure: <br />
 
Function structure: <br />
sety('object',value);<br />
+
x3d(object).sethue = value<br />
 +
sethue ('object','value');
 
<br />
 
<br />
 
Example: <br />
 
Example: <br />
sety('welcomeimg',200);<br />
+
x3d(welcomeimg).sethue = 0.85<br />
The image in this example will now be placed 200 pixels to the bottom.<br />
+
sethue ('welcomeimg',0.85);<br />
+
Values that are allowed are: between -1 and 1 OR -100 and 100.
<br /><br />
 
 
Function name: <br />
 
'''setz'''<br />
 
<br />
 
Function description: <br />
 
Changes on which layer the object / image resides. ( where 0 is in the back )<br />
 
<br />
 
Function structure: <br />
 
setz('object',value);<br />
 
 
<br />
 
<br />
Example: <br />
+
Returns:<br />
setz('welcomeimg',10);<br />
+
object or 'error <br />
The value is the layer on which the object / image is placed, where the layer 0 is in the back.<br />
 
The object / image that is already active on the chosen layer will be placed 1 place higher into the layers.<br />
 
  
 
<br /><br />
 
<br /><br />
  
 
Function name: <br />
 
Function name: <br />
'''setstroke'''<br />
+
===='''setsaturation'''====
<br />
 
Function description: <br />
 
Changes the stroke of an object.<br />
 
<br />
 
Function structure: <br />
 
setstroke('object',value);<br />
 
 
<br />
 
<br />
Example: <br />
 
setstroke('newrect',20);<br />
 
The object gets a line around the object with the size of the value in pixels.<br />
 
 
<br /><br />
 
 
Function name: <br />
 
'''setstrokecolor'''<br />
 
 
<br />
 
<br />
 
Function description: <br />
 
Function description: <br />
Changes the color of the objects' stroke.<br />
+
Places a filter above an object / image that changes its saturation.<br />
 
<br />
 
<br />
 
Function structure: <br />
 
Function structure: <br />
setstrokecolor('object','value');<br />
+
x3d(object).setsaturation= value<br />
 +
setsaturation('object','value');
 
<br />
 
<br />
 
Example: <br />
 
Example: <br />
setstrokecolor('newrect','blue');<br />
+
x3d(welcomeimg).setsaturation = 0.85<br />
+
setsaturation('welcomeimg',0.85);<br />
<br /><br />
+
Values that are allowed are: between -1 and 1 OR -100 and 100.
 
Function name: <br />
 
'''settextfont'''<br />
 
 
<br />
 
<br />
Function description: <br />
+
Returns:<br />
Changes the text font of an text object.<br />
+
object or 'error <br />
<br />
+
 
Function structure: <br />
 
settextfont('object','value');<br />
 
<br />
 
Example: <br />
 
settextfont('welcometext','Arial');<br />
 
The text font must exist, if this is not the case the text font will remain the same. Attention: Case sensitive!<br />
 
You can download text fonts directly from fonts.google.com or through a url link.<br />
 
 
 
<br /><br />
 
<br /><br />
+
 
 
Function name: <br />
 
Function name: <br />
'''settextsize'''<br />
+
===='''setbrightness'''====
 
<br />
 
<br />
Function description: <br />
 
Changes the text size of a text object.<br />
 
<br />
 
Function structure: <br />
 
settextsize('object',value);<br />
 
<br />
 
Example: <br />
 
settextsize('welcometext',20);<br />
 
The value is the text size in pixels.<br />
 
 
<br /><br />
 
 
Function name: <br />
 
'''settextweight'''<br />
 
 
<br />
 
<br />
 
Function description: <br />
 
Function description: <br />
Changes the boldness of an text object.<br />
+
Places a filter above an object / image that changes its brightness.<br />
 
<br />
 
<br />
 
Function structure: <br />
 
Function structure: <br />
settextweight('object','value');<br />
+
x3d(object).setbrightness = value<br />
 +
setbrightness('object','value');
 
<br />
 
<br />
 
Example: <br />
 
Example: <br />
settextweight('welcometext',400);<br />
+
x3d(welcomeimg).setbrightness= 0.85<br />
Possible values: light, normal, bold, number.<br />
+
setbrightness('welcomeimg',0.85);<br />
+
Values that are allowed are: between -1 and 1 OR -100 and 100.
<br /><br />
 
 
Function name: <br />
 
'''setvisible'''<br />
 
<br />
 
Function description: <br />
 
Changes the visibility of an object / image / canvas.<br />
 
<br />
 
Function structure: <br />
 
setvisible('object',waarde);<br />
 
 
<br />
 
<br />
Example: <br />
+
Returns:<br />
setvisible('welcometext',0.7);<br />
+
object or 'error <br />
To make the canvas visible or invisible the value must be either 1 or 0 where 0 makes it invisible and 1 makes it visible.<br />
 
To make an object / image visible or invisible the value must be between 0 and 1, where 1 is visible and 0 is invisible, decimals may be used.<br />
 
  
 
<br /><br />
 
<br /><br />
+
 
Function name:<br />
 
'''setflipx'''<br />
 
<br />
 
Function description: <br />
 
Flips the object / image around. (Horizontally)<br />
 
<br />
 
Function structure: <br />
 
setflipx('object','value');<br />
 
<br />
 
Example: <br />
 
setflipx('welcomeimg','true');<br />
 
The 'value' true flips the object / image around from it original stance, the value 'false' changes it back to it's original stance.<br />
 
The value 'flip' makes the object / image flip around no matter which stance it currently is.<br />
 
 
<br /><br />
 
  
 
Function name: <br />
 
Function name: <br />
'''setflipy'''<br />
+
===='''setgamma'''====
 
<br />
 
<br />
Function description: <br />
 
Flips the object / image around. (Vertically)<br />
 
<br />
 
Function structure: <br />
 
setflipy('object','value');<br />
 
<br />
 
Example: <br />
 
setflipy('welcomeimg','true');<br />
 
The 'value' true flips the object / image around from it original stance, the value 'false' changes it back to it's original stance.<br />
 
The value 'flip' makes the object / image flip around no matter which stance it currently is.<br />
 
 
<br /><br />
 
 
Function name: <br />
 
'''setdefault'''<br />
 
 
<br />
 
<br />
 
Function description: <br />
 
Function description: <br />
Changes the default properties of which an object / image is loaded in with.<br />
+
Changes the gamma (Red, Green, Blue) of an image.<br />
 
<br />
 
<br />
 
Function structure: <br />
 
Function structure: <br />
setdefault('object','property,propertyvalue');<br />
+
x3d(object).setgamma= value<br />
 +
setgamma('object','value');
 
<br />
 
<br />
 
Example: <br />
 
Example: <br />
setdefault('text','fill,red';<br />
+
x3d(welcomeimg).setgamma= 256,0,31<br />
 +
setgamma('welcomeimg','256,0,31');<br />
 +
Values that are allowed are: between 0 and 256. <br />
 +
Values must be written in 'string literals': '256,current,|' <br />
 +
Value must consist of 3 values; Red, Green, Blue. If you wish to only change 1 value for example green you can use 'current' or '|'. Example: <br />
 +
'256,current,34'.
 +
<br />
 +
Returns:<br />
 +
object or 'error <br />
  
 
<br /><br />
 
<br /><br />
  
===Retrieving object / imag properties===
+
==='''Retrieving object / image properties'''===
 
+
These functions 'get' a property of the object / image, they return this property and could thus be used for testing or to fill variables for example.<br />
 
<br /><br />
 
<br /><br />
  
 
Function name: <br />
 
Function name: <br />
'''getproperty'''<br />
+
===='''getproperty'''====
 +
<br />
 
<br />
 
<br />
 
Function description: <br />
 
Function description: <br />
Line 1,319: Line 1,039:
 
<br />
 
<br />
 
Function structure: <br />
 
Function structure: <br />
 +
x3d(object).getproperty = value<br />
 
getproperty('object','value');<br />
 
getproperty('object','value');<br />
 
<br />
 
<br />
 
Example: <br />
 
Example: <br />
 +
x3d(welcomeimg).getproperty = top<br />
 
getproperty('welcomeimg','top');<br />
 
getproperty('welcomeimg','top');<br />
 
The value is the property you wish to retrieve.<br />
 
The value is the property you wish to retrieve.<br />
 +
<br />
 +
Returns:<br />
 +
propertyvalue<br />
 
 
 
<br /><br />
 
<br /><br />
  
 
Function name: <br />
 
Function name: <br />
'''getx'''<br />
+
===='''getx'''====
 +
<br />
 
<br />
 
<br />
 
Function description: <br />
 
Function description: <br />
Line 1,334: Line 1,060:
 
<br />
 
<br />
 
Function structure: <br />
 
Function structure: <br />
 +
x3d(object).getx = value<br />
 
getx('object');<br />
 
getx('object');<br />
 
<br />
 
<br />
 
Example: <br />
 
Example: <br />
 +
x3d(welcomeimg).getx = 1<br />
 
getx('welcomeimg');<br />
 
getx('welcomeimg');<br />
+
To use this function through the outputscript, you only need to enter an object(id).<br />
 +
To use this function through the rules, you must enter a value of either 1 or 0.<br />
 +
Note: This function returns the value of which the object resides in at that moment and time, if the object is in animation this might not be the end position.<br />
 +
<br />
 +
Returns:<br />
 +
x (left) value<br />
 +
 
<br /><br />
 
<br /><br />
 
 
 
Function name: <br />
 
Function name: <br />
'''gety'''<br />
+
===='''gety'''====
 +
<br />
 
<br />
 
<br />
 
Function description: <br />
 
Function description: <br />
Line 1,348: Line 1,083:
 
<br />
 
<br />
 
Function structure: <br />
 
Function structure: <br />
 +
x3d(object).gety = value<br />
 
gety('object');<br />
 
gety('object');<br />
 
<br />
 
<br />
 
Example: <br />
 
Example: <br />
 +
x3d(welcomeimg).gety = 1<br />
 
gety('welcomeimg');<br />
 
gety('welcomeimg');<br />
+
To use this function through the outputscript, you only need to enter an object(id).<br />
 +
To use this function through the rules, you must enter a value of either 1 or 0.<br />
 +
Note: This function returns the value of which the object resides in at that moment and time, if the object is in animation this might not be the end position.<br />
 +
<br />
 +
Returns:<br />
 +
y (top) value<br />
 +
 
 
<br /><br />
 
<br /><br />
  
 
Function name: <br />
 
Function name: <br />
'''getz'''<br />
+
===='''getz'''====
 +
<br />
 
<br />
 
<br />
 
Function description: <br />
 
Function description: <br />
Line 1,362: Line 1,106:
 
<br />
 
<br />
 
Function structure: <br />
 
Function structure: <br />
 +
x3d(object).getz = value<br />
 
getz('object');<br />
 
getz('object');<br />
 
<br />
 
<br />
 
Example: <br />
 
Example: <br />
 +
x3d(welcomeimg).getz = 1<br />
 
getz('welcomeimg');<br />
 
getz('welcomeimg');<br />
 +
To use this function through the outputscript, you only need to enter an object(id).<br />
 +
To use this function through the rules, you must enter a value of either 1 or 0.<br />
 +
<br />
 +
Returns:<br />
 +
z (layer) value<br />
 
 
 
<br /><br />
 
<br /><br />
 
 
 
Function name: <br />
 
Function name: <br />
'''getscale'''<br />
+
===='''getscale'''====
 +
<br />
 
<br />
 
<br />
 
Function description: <br />
 
Function description: <br />
Line 1,376: Line 1,128:
 
<br />
 
<br />
 
Function structure: <br />
 
Function structure: <br />
 +
x3d(object).getscale = value<br />
 
getscale('object');<br />
 
getscale('object');<br />
 
<br />
 
<br />
 
Example: <br />
 
Example: <br />
 +
x3d(welcomeimg).getscale = 1<br />
 
getscale('welcomeimg');<br />
 
getscale('welcomeimg');<br />
 +
To use this function through the outputscript, you only need to enter an object(id).<br />
 +
To use this function through the rules, you must enter a value of either 1 or 0.<br />
 +
<br />
 +
Returns:<br />
 +
scale (x&y) value<br />
 
 
 
<br /><br />
 
<br /><br />
 
 
 
Function name: <br />
 
Function name: <br />
'''getscalex'''<br />
+
===='''getscalex'''====
 +
<br />
 
<br />
 
<br />
 
Function description: <br />
 
Function description: <br />
Line 1,390: Line 1,150:
 
<br />
 
<br />
 
Function structure: <br />
 
Function structure: <br />
 +
x3d(object).getscalex = value<br />
 
getscalex('object');<br />
 
getscalex('object');<br />
 
<br />
 
<br />
 
Example: <br />
 
Example: <br />
getscalex('welcomeimg');<br />
+
x3d(welcomeimg).getscalex = 1<br />
 +
getscalex('welcomeimg'):<br />
 +
To use this function through the outputscript, you only need to enter an object(id).<br />
 +
To use this function through the rules, you must enter a value of either 1 or 0.<br />
 +
<br />
 +
Returns:<br />
 +
scalex value<br />
 
 
 
<br /><br />
 
<br /><br />
 
 
 
Function name: <br />
 
Function name: <br />
'''getscaley'''<br />
+
===='''getscaley'''====
 +
<br />
 
<br />
 
<br />
 
Function description: <br />
 
Function description: <br />
Line 1,404: Line 1,172:
 
<br />
 
<br />
 
Function structure: <br />
 
Function structure: <br />
 +
x3d(object).getscaley = value<br />
 
getscaley('object');<br />
 
getscaley('object');<br />
 
<br />
 
<br />
 
Example: <br />
 
Example: <br />
 +
x3d(welcomeimg).getscaley = 1<br />
 
getscaley('welcomeimg');<br />
 
getscaley('welcomeimg');<br />
 +
To use this function through the outputscript, you only need to enter an object(id).<br />
 +
To use this function through the rules, you must enter a value of either 1 or 0.<br />
 +
<br />
 +
Returns:<br />
 +
scaley value<br />
  
 
<br /><br />
 
<br /><br />
  
===Other functions===
+
Function name: <br />
 +
===='''getfilter'''====
 +
<br />
 +
<br />
 +
Function description: <br />
 +
Gets the objects filter.<br />
 +
<br />
 +
Function structure: <br />
 +
x3d(object).getfilter = filtername<br />
 +
getfilter('object', 'filtername');<br />
 +
<br />
 +
Example: <br />
 +
x3d(welcomeimg).getfilter = rotation<br />
 +
getfilter('welcomeimg','rotation');<br />
 +
<br />
 +
Returns:<br />
 +
filter<br />
 +
 
 +
<br /><br />
 +
 
 +
Function name: <br />
 +
===='''getfilterindex'''====
 +
<br />
 +
<br />
 +
Function description: <br />
 +
Gets the index of an objects' filter.<br />
 +
<br />
 +
Function structure: <br />
 +
x3d(object).getfilterindex = filtername<br />
 +
getfilterindex('object', 'filtername');<br />
 +
<br />
 +
Example: <br />
 +
x3d(welcomeimg).getfilterindex = 'rotation'<br />
 +
getfilterindex('welcomeimg', 'rotation');<br />
 +
<br />
 +
Returns:<br />
 +
filter index<br />
 +
 
 +
<br /><br />
  
 +
==='''Other functions'''===
 +
These functions don't add/alter objects / images.<br />
 +
They are classified as 'other' functions for this reason.<br />
 
<br /><br />
 
<br /><br />
  
 
Function name: <br />
 
Function name: <br />
'''copy'''<br />
+
===='''copy'''====
 +
<br />
 
<br />
 
<br />
 
Function description: <br />
 
Function description: <br />
Line 1,422: Line 1,239:
 
<br />
 
<br />
 
Function structure: <br />
 
Function structure: <br />
 +
x3d(object).copy = value<br />
 
copy('object','value');<br />
 
copy('object','value');<br />
 
<br />
 
<br />
 
Example: <br />
 
Example: <br />
 +
x3d(welcomeimg).copy = newimage<br />
 
copy('welcomeimg','newimage');<br />
 
copy('welcomeimg','newimage');<br />
 
The new id (value) must be unique. (can't already exist)<br />
 
The new id (value) must be unique. (can't already exist)<br />
 +
Note: When copying an object/image the new object/image will be placed ontop of the copied object/image.<br />
 +
<br />
 +
Returns:<br />
 +
cloned object or 'error'<br />
 
 
 
<br /><br />
 
<br /><br />
 
 
Function name: <br />
+
Function name: <br />
'''delete'''<br />
+
 
 +
===='''delete/deletethis'''====
 +
<br />
 
<br />
 
<br />
 
Function description: <br />
 
Function description: <br />
Line 1,437: Line 1,262:
 
<br />
 
<br />
 
Function structure: <br />
 
Function structure: <br />
delete('object');<br />
+
x3d(object).delete = value<br />
 +
deletethis('object');<br />
 
<br />
 
<br />
 
Example: <br />
 
Example: <br />
delete('newimage');<br />
+
x3d(newimage).delete = 1<br />
To use this function, you only need to enter a object(id).<br />
+
deletethis('newimage');<br />
 +
If you wish to use this function in the outputscript you must use 'deletethis' otherwise an error will occur.<br />
 +
Using this function in the rules works with both 'delete' and 'deletethis'.<br />
 +
To use this function through the outputscript, you only need to enter an object(id).<br />
 +
To use this function through the rules, you must enter a value of either 1 or 0.<br />
 +
<br />
 +
Returns:<br />
 +
'success' or 'error'<br />
  
  
 
<br /><br />
 
<br /><br />
 
 
Function name: <br />
+
Function name: <br />
'''clearcanvas'''<br />
+
 
 +
===='''clearcanvas'''====
 +
<br />
 
<br />
 
<br />
 
Function description: <br />
 
Function description: <br />
Line 1,453: Line 1,288:
 
<br />
 
<br />
 
Function structure: <br />
 
Function structure: <br />
 +
x3d(object).clearcanvas = value<br />
 
clearcanvas('object');<br />
 
clearcanvas('object');<br />
 
<br />
 
<br />
 
Example: <br />
 
Example: <br />
 +
x3d(c).clearcanvas = 1<br />
 
clearcanvas('c');<br />
 
clearcanvas('c');<br />
To use this function, you only need to enter a object(id).<br />
+
To use this function through the outputscript, you only need to enter an object(id).<br />
 +
To use this function through the rules, you must enter a value of either 1 or 0.<br />
 
The object(id) in this case is that of the canvas.<br />
 
The object(id) in this case is that of the canvas.<br />
 +
<br />
 +
Returns:<br />
 +
canvas or 'error'<br />
 
 
 
<br /><br />
 
<br /><br />
  
 
Function name: <br />
 
Function name: <br />
'''screenshot'''<br />
+
===='''screenshot'''====
 +
<br />
 
<br />
 
<br />
 
Function description: <br />
 
Function description: <br />
Line 1,469: Line 1,311:
 
<br />
 
<br />
 
Function structure: <br />
 
Function structure: <br />
 +
x3d(object).screenshot = value<br />
 
screenshot('object');<br />
 
screenshot('object');<br />
 
<br />
 
<br />
 
Example: <br />
 
Example: <br />
 +
x3d(c).screenshot = 1<br />
 
screenshot('c');<br />
 
screenshot('c');<br />
To use this function, you only need to enter a object(id).<br />
+
To use this function through the outputscript, you only need to enter an object(id).<br />
 +
To use this function through the rules, you must enter a value of either 1 or 0.<br />
 
The object(id) in this case is that of the canvas.<br />
 
The object(id) in this case is that of the canvas.<br />
 +
<br />
 +
Returns:<br />
 +
screenshot name or 'error'<br />
  
 
<br /><br />
 
<br /><br />
 +
 +
Function name: <br />
 +
 +
==='''saveconfig'''===
 +
<br />
 +
<br />
 +
Function description: <br />
 +
Saves the canvas(ses) data to the server.<br />
 +
<br />
 +
Function structure: <br />
 +
x3d(savename).saveconfig = names of canvas(ses) to save<br />
 +
saveconfig('savename','names of canvas(ses) to save';<br />
 +
<br />
 +
Example: <br />
 +
x3d(firstdesign).saveconfig = firstcanvas,secondcanvas<br />
 +
saveconfig('firstdesign', 'firstcanvas,secondcanvas');<br />
 +
When no canvas(ses) are chosen, every canvas will get saved.
 +
<br />
 +
Returns:<br />
 +
data (log) temporary<br />
 +
 +
<br /><br />
 +
 +
Function name: <br />
 +
 +
==='''buildconfig'''===
 +
<br />
 +
<br />
 +
Function description: <br />
 +
Loads the content from the server into the canvas(ses).<br />
 +
<br />
 +
Function structure: <br />
 +
x3d(savename).buildconfig = firstcanvas, secondcanvas<br />
 +
buildconfig('savename', 'firstcanvas,secondcanvas');<br />
 +
<br />
 +
Example: <br />
 +
x3d(firstdesign).buildconfig= 1<br />
 +
buildconfig('firstdesign');<br />
 +
To use this function use 'saveconfig' first, make sure the view (savename) is the same as the name used in 'saveconfig' (case sensitive).
 +
<br />
 +
Returns:<br />
 +
'succes' (temporary)<br />

Latest revision as of 14:42, 6 May 2021

Back to the manual

Explanation per individual function


Here you can find all the documentation for each individual functions.
How to use the functions, what they do and more.


If you wish to try out the functions in a safe and easy-to-use enviroment, visit: Demo


Adding / altering (existent) objects / images:

These functions can be used to add objects / images to the canvas.
If objects already exist they will be altered.


Function name:

setcanvas



Function description:
Changes the default canvas to a fabric canvas.

Function structure:
x3d(object).setcanvas;
setcanvas('object');

Example:
x3d(c).setcanvas;
setcanvas('c');
The objects(id) must be the same as

Returns:
canvas




Function name:

settext



Function description:
Adds a text object to a canvas or changes the text of an already existent text object.

Function structure:
x3d(object).settext = value
settext('object','value');

Example:
x3d(welcometext).settext = Hello World!
settext('welcometext','Hello World!');
In case a text object already exists; When the id matches that of an already existent text object, the text of this object is then replaced by the given value.
If you wish to split a sentence (enter), you can use \n.
An example of this: x3d('welcomeimg').settext = Hello \n World! or settext('welcomeimg','Hello \n World!');

Returns:
add: object
alter: object or 'error'



Function name:

setimage



Function description:
Adds a image to a canvas or changes the source/url or data string of an already existent image.

Function structure:
x3d(object).setimage = source/url/data-string
setimage('object','source/url/data-string);

Example:
x3d('welcomeimg').setimage = /Images/pug.png
setimage('welcomeimg','/Images/pug.png');
In case a image already exists; When the id matches that of an already existent image, the source/url or datastring of this image will be replaced by the given value.
supported: source/url/data/svg

Returns:
add: object
alter: object or 'error'



Function name:

setbgimg



Function description:
Adds a background image to a canvas or changes the current background image, the image fills the entire canvas.

Function structure:
x3d(object).setbgimg = source/url/data-string
setbgimg('object','source/url/data-string);

Example:
x3d(bgimg).setbgimg = /Images/pineapples.png
setbgimg('bgimg','/Images/pineapples.png');
In case a background image already exists; When the id matches that of an already existing background image, the source/url or data string of this background image will be replaced by the given value.
When you add a background image with another id whilst a background image is already active on that canvas, the lastest added background image will be the one shown because of the layering structure. (see setz)

Returns:
object



Function name:

setrectangle



Function description:
Adds a rectangle to a canvas or changes an already existent rectangle. ( position, height and width )

Function structure:
x3d(object).setrectangle = x1,y1,x2,y2
setrectangle('object','x1,y1,x2,y2');

Example:
x3d(newrect).setrectangle = 50,50,100,100
setrectangle('newrect','50,50,100,100');
The rectangle in this example starts ( starting top left (0,0)) 50 pixels to the right and 50 pixels to the bottom.
In case a rectangle with this id is already existent, the locations ( and the width,height ) are changed.

Returns:
add: object
alter: object or 'error'



Function name:

setcircle



Function description:
Adds a circle to a canvas or changes an already existent circle. ( position and radius )

Function structure:
x3d(object).setcircle = x,y,radius
setcircle('object','x,y,radius');

Example:
x3d(newcircle).setcircle = 50,50,25
setcircle('newcircle','50,50,25');
The circle in this example starts ( starting top left (0,0)) 50 pixels to the right and 50 pixels to the bottom and gets a 25 pixel radius.
In case a circle with this id is already existent, the location and radius is changed.

Returns:
add: object
alter: object or 'error'



Function name:

settriangle



Function description:
Adds a triangle to a canvas or changes an already existent circle. ( position, height and width )

Function structure:
x3d(object).settriangle = x,y,width,height
settriangle('object','x,y,width,height');

Example:
x3d(newtriangle).settriangle = 50,50,75,75
settriangle('newtriangle','50,50,75,75');
The triangle in this example starts ( starting top left (0,0)) 50 pixels to the right and 50 pixels to the bottom and get a 75 pixels height and a 75 pixels width.
In case a triangle with this id is already existent, the location, height and width are changed.

Returns:
add: object
alter: object or 'error'



Function name:

setpolygon



Function description:
Adds a polygon to a canvas or changes an already existent polygon, the begin and endpoint always connect. ( positions)

Function structure:
x3d(object).setpolygon = x1,y1,x2,y2 etc.
setpolygon('object','x1,y1,x2,y2 etc.');

Example:
x3d(newpoly).setpolygon = 20,0,40,50,60,80,40,70,20,60
setpolygon('newpoly','20,0,40,50,60,80,40,70,20,60');
The polygon in this example starts ( starting top left (0,0)) 20 pixels to the right and 0 pixels to the bottom, the second point is 40 pixels to the right and 50 pixels to the bottom etc.
The end of the polygon always connects with the beginpoint.
In case a triangle with this id is already existent, the points get changed.

Returns:
add: object
alter: object or 'error'



Function name:

setarrows



Function description:
Adds a line to the canvas with 2 arrowpoints or replaces an already existing arrow/line.

Function structure:
x3d(object).setarrows = x1,y1,x2,y2
setarrows('object','x1,y1.x2.y2');

Example:
x3d(newarrow).setarrows = 100,100,300,300
setarrows('newarrow','100,100,300,300');
The arrow in this example starts ( starting top left (0,0)) 100 pixels to the right and 100 pixels to the bottom and stops 300 pixels to the right and 300 pixels to the bottom.
In case a arrow with this id is already existent (setline,setarrow,setarrows), the positions are replaced with the given value and if required arrowpoints are added/removed.

Returns:
object(s) or 'error'



Function name:

setarrow



Function description:
Adds a line to a canvas with 1 arrowpoint or replaces an already existing arrow/line.

Function structure:
x3d(object).setarrow = x1,y1,x2,y2
setarrow('object','x1,y1,x2,y2');

Example:
x3d(newarrow).setarrows = 100,100,300,300
setarrow('newarrow','100,100,300,300'); The arrow in this example starts ( starting top left (0,0)) 100 pixels to the right and 100 pixels to the bottom and stops 300 pixels to the right and 300 pixels to the bottom.
In case a arrow with this id is already existent (setline,setarrow,setarrows), the positions are replaced with the given value and if required arrowpoints are added/removed.

Returns:
object(s) or 'error'



Function name:

setline



Function description:
Adds a line to a canvas or replaces an already existing arrow/line.

Function structure:
x3d(object).setline = x1,y1,x2,y2
setline('object','x1,y1,x2,y2');
Example:
x3d(newarrow).setline = 100,100,300,300
setline('newarrow','100,100,300,300');
The arrow in this example starts ( starting top left (0,0)) 100 pixels to the right and 100 pixels to the bottom and stops 300 pixels to the right and 300 pixels to the bottom.
In case a arrow with this id is already existent (setline,setarrow,setarrows), the positions are replaced with the given value and if required arrowpoints are added/removed.

Returns:
object or 'error'



Altering existent objects / images

These functions alter an already existent object' / image' property.

Function name:

setcolor



Function description:
Changes the color of an object.

Function structure:
x3d(object).setcolor = value
setcolor('object','value');

Example:
x3d(welcometext).setcolor = red
setcolor('welcometext','red');
When the object is a canvas the background color is changed to the given value.
The value can be a color in: string, hex and rgb.

Returns:
object or 'error'



Function name:

setdraggable



Function description:
Changes the object to be static or dynamic ( user interaction )

Function structure:
x3d(object).setdraggable = value
setdraggable('object','value');

Example:
x3d(welcomeimg).setdraggable = 1
setdraggable('welcomeimg','1');
The value can either be 1 or 0, where 0 makes the object static and 1 makes the object draggable.
Objects that are NOT draggable will still have events, the user will not be able to move/scale/rotate the object/image.
Returns:
object or 'error'



Function name:

setanimationduration



Function description:
Changes the duration of animations.

Function structure:
x3d().setanimationduration = duration
setanimationduration('duration');

Example:
x3d(object).setanimationduration = 1000
setanimationduration('1000'); In this example the animation duration is set to 1000ms (1 second).
The animation duration counts for all animations until it is altered again.

Returns:
animation duration or 'error'



Function name:

setanimationtype



Function description:
Changes which animation is played when positions change.

Function structure:
x3d().setanimationtype = value
setanimationtype('value');

Example:
x3d().setanimationtype = easeInOutBounce
setanimationtype('easeInOutBounce');
In this example the animation type is set to InOutBounce, this makes the object 'bounce' at the end of an position change.
The animation type counts for all animations until it is altered again.

Returns:
animation name or 'error'



Function name:

sethandles



Function description:
Changes the handles of an object depended on the value.

Function structure:
x3d(object).sethandles = value
sethandles('object','value');
Example:
x3d(newrect).sethandles = 2
sethandles('newrect','2');
Changes which lines and or user interactive corners are visible.

Returns:
object or 'error'



Function name:

sethandlecolor



Function description:
Changes the color of the handles.

Function structure:
x3d(object).sethandlecolor = value
sethandlecolor('object','value');

Example:
x3d(newrect).sethandlecolor = red
sethandlecolor('newrect','red');
This function changes the color of all handlers, visible or invisible.
The value can be a color in: string, hex and rgb.

Returns:
object or 'error'



Function name:

setheight



Function description:
Changes the height of an object in pixels.

Function structure:
x3d(object).setheight = value
setheight('object',value);

Example:
x3d(welcomeimg).setheight = 150
setheight('welcomeimg',150);

Returns:
object or 'error'



Function name:

setwidth



Function description:
Changes the width of an object in pixels.

Function structure:
x3d(object).setwidth = value
setwidth('object',value);

Example:
x3d(welcomeimg).setwidth = 250
setwidth('welcomeimg',250);

Returns:
object or 'error'



Function name:

setscale



Function description:
Changes the width and height of an object or image by scale.

Function structure:
x3d(object).setscale = value
setscale('object',value);

Example:
x3d(welcomeimg).setscale = 0.8
setscale('welcomeimg',0.8)
The value represents the scale on which the object / image is scaled. ( x and y axle )
The value 1 is the original value.

Returns:
object or 'error'



Function name:

setid



Function description:
Changes the id of an already existent object / image.

Function structure:
x3d(object).setid = value
setid('object','value');

Example:
x3d(welcomeimg).setid = goodbyeimg
setid('welcomeomg','goodbyeimg');
The object is the id of an object that is to be changed, the value is to become the new id.
The new id must not be existent on the canvas.

Returns:
object or 'error'



Function name:

setlineheight



Function description:
Changes how much height is between text lines.

Function structure:
x3d(object).setlineheight = value
setlineheight('object',value);

Example: x3d(welcometext).setlineheight = 10 setlineheight('welcometext',10);

Returns:
object or 'error'



Function name:

setrotation



Function description:
Changes the rotation of an object / image.

Function structure:
x3d(object).setrotation = value
setrotation('object',value);

Example:
x3d(welcomeimg).setrotation = 90
setrotation('welcomeimg',90);
The value is the rotation starting from the original rotationpoint (0) in degrees. (celcius)
The object / image is always rotated from its most center point.
This function is animated if an animation is set.

Returns:
object or 'error'



Function name:

setx



Function description:
Changes the position of an object / image on the x-axle. (in pixels where the left is 0)

Function structure:
x3d(object).setx = value
setx('object',value);

Example:
x3d(welcomeimg).setx = 500
setx('welcomeimg',500);
The image in this example will now be placed 500 pixels to the right.
This function can be animated dependend on the animationtype and duration.
Using the setx and sety function together will make the object / image move diagonally.
This function is animated if an animation is set.

Returns:
object or 'error'



Function name:

sety



Function description:
Changes the position of an object / image on the y-axle. (in pixels where the top is 0)

Function structure:
x3d(object).sety = value
sety('object',value);

Example:
x3d(welcomeimg).sety = 200
sety('welcomeimg',200);
The image in this example will now be placed 200 pixels to the bottom.
This function can be animated dependend on the animationtype and duration.
Using the setx and sety function together will make the object / image move diagonally.
This function is animated if an animation is set.

Returns:
object or 'error'



Function name:

setz



Function description:
Changes on which layer the object / image resides. ( where 0 is in the back )

Function structure:
x3d(object).setz = value
setz('object',value);

Example:
x3d(welcomeimg).setz = 10
setz('welcomeimg',10);
The value is the layer on which the object / image is placed, where the layer 0 is in the back.
The object / image that is already active on the chosen layer will be placed 1 place higher into the layers.

Returns:
object or 'error'



Function name:

setstroke



Function description:
Changes the stroke of an object.

Function structure:
x3d(object).setstroke = value
setstroke('object',value);

Example:
x3d(newrect).setstroke = 20
setstroke('newrect',20);
The object gets a line around the object with the size of the value in pixels.

Returns:
object or 'error'



Function name:

setstrokecolor



Function description:
Changes the color of the objects' stroke.

Function structure:
x3d(object).setstrokecolor = value
setstrokecolor('object','value');

Example:
x3d(newrect).setstrokecolor = blue
setstrokecolor('newrect','blue');
The value can be a color in: string, hex and rgb.

Returns:
object or 'error'



Function name:

settextfont



Function description:
Changes the text font of an text object.

Function structure:
x3d(object).settextfont = value
settextfont('object','value');

Example:
x3d(welcometext).settextfont = Arial
settextfont('welcometext','Arial');
The text font must exist, if this is not the case the text font will remain the same. Attention: Case sensitive!
You can download text fonts directly from fonts.google.com or through a url link.

Returns:
object or 'error'



Function name:

settextsize



Function description:
Changes the text size of a text object.

Function structure:
x3d(object).settextsize = value
settextsize('object',value);

Example:
x3d(welcometext).settextsize = 20
settextsize('welcometext',20);
The value is the text size in pixels.

Returns:
object or 'error'



Function name:

settextweight



Function description:
Changes the boldness of an text object.

Function structure:
x3d(object).settextweight = value
settextweight('object',value);

Example:
x3d(welcometext).settextweight = 400
settextweight('welcometext',400);
Possible values: light, normal, bold, number.

Returns:
object or 'error'



Function name:

setvisible



Function description:
Changes the visibility of an object / image / canvas.

Function structure:
x3d(object).setvisible = value
setvisible('object',value);

Example:
x3d(welcometext).setvisible = 0.7
setvisible('welcometext',0.7);
To make the canvas visible or invisible the value must be either 1 or 0 where 0 makes it invisible and 1 makes it visible.
To make an object / image visible or invisible the value must be between 0 and 1, where 1 is visible and 0 is invisible, decimals may be used.
This function is animated if an animation is set.

Returns:
object or 'error'



Function name:

setflipx



Function description:
Flips the object / image around. (Horizontally)

Function structure:
x3d(object).setflipx = value
setflipx('object','value');
Example:
x3d(welcomeimg).setflipx = true
setflipx('welcomeimg','true');
The 'value' true flips the object / image around from it original stance, the value 'false' changes it back to it's original stance.
The value 'flip' makes the object / image flip around no matter which stance it currently is.

Returns:
object or 'error'



Function name:

setflipy



Function description:
Flips the object / image around. (Vertically)

Function structure:
x3d(object).setflipy = value
setflipy('object','value');

Example:
x3d(welcomeimg).setflipy = flip
setflipy('welcomeimg','flip');
The 'value' true flips the object / image around from it original stance, the value 'false' changes it back to it's original stance.
The value 'flip' makes the object / image flip around no matter which stance it currently is.

Returns:
object or 'error'



Function name:

setdefault



Function description:
Changes the default properties of which an object / image is loaded in with.

Function structure:
x3d(object).setdefault = property,propertyvalue
setdefault('object','propertympropertyvalue');
Example:
x3d(text).setdefault = fill,red
setdefault('text','fill,red');
Object defines the type of object, this could for example be; 'Text','Image','Rectangle','Arrow','Circle',Etc.
Neither the property, nor the propertyvalue is case sensitive.

Returns:
default properties or 'error'



Function name:

setcornersize



Function description:
Changes the size of the handle corners.

Function structure:
x3d(object).setcornersize = value
setcornersize('object','value');
Example:
x3d(welcomeimg).setcornersize = 8
setcornersize('welcomeimg',8);

Returns:
object or 'error'



Function name:

setcornercolor



Function description:
Changes the color of the handle corners.

Function structure:
x3d(object).setcornercolor = value
setcornercolor('object','value');
Example:
x3d(welcomeimg).setcornercolor = Red
setcornercolor('welcomeimg','Red');

Returns:
object or 'error'



Function name:

setbordercolor



Function description:
Changes the color of the handle line.

Function structure:
x3d(object).setbordercolor = value
setbordercolor('object','value');
Example:
x3d(welcomeimg).setbordercolor = Red
setbordercolor('welcomeimg','Red');

Returns:
object or 'error'



Function name:

settransparentcorners



Function description:
Changes the transparancy of the handle corners.

Function structure:
x3d(object).settransparentborders = value
settransparentborders('object','value');
Example:
x3d(welcomeimg).settransparentborders = true
settransparentborders('welcomeimg',true);

Returns:
object or 'error'



Function name:

setgroup



Function description:
Wraps a fabric group element around one or more object(s).

Function structure:
x3d(group).setgroup = object(s)
setgroup('group','object(s)');
Example:
x3d(welcomegroup).setgroup = welcometext, welcomeimg, welcomesign
setgroup('welcomegroup','welcometext,welcomeimg,welcomesign');

Returns:
group or 'error'



Function name:

settextpattern



Function description:
Lays a (image) pattern over a text object.

Function structure:
x3d(object).settextpattern = src/url
settextpattern('object','src/url');
Example:
x3d(welcometext).settextpattern = Images/pineapples.png
settextpattern('welcometext','Images/pineapples.png');

Returns:
object or 'error'



Function name:

ungroup



Function description:
Removes an already existent group from the canvas.

Function structure:
x3d(group).ungroup = value
ungroup('group','value');
Example:
x3d(welcomegroup).ungroup = 1
ungroup('welcomegroup',1);

Returns:
group or 'error'



Function name:

setdraganddrop



Function description:
Enables/disables html image drag and drop onto the canvas.

Function structure:
x3d().setdraganddrop = value
setdraganddrop(,'value');
Example:
x3d().setdraganddrop = true
setdraganddrop(,true);
Only images with the property: " draggable = 'true' " are draggable onto the canvas.

Returns:
draggable images or 'error'



Function name:

sethue



Function description:
Places a filter above an object / image that changes its hue vibrance.

Function structure:
x3d(object).sethue = value
sethue ('object','value');
Example:
x3d(welcomeimg).sethue = 0.85
sethue ('welcomeimg',0.85);
Values that are allowed are: between -1 and 1 OR -100 and 100.
Returns:
object or 'error



Function name:

setsaturation



Function description:
Places a filter above an object / image that changes its saturation.

Function structure:
x3d(object).setsaturation= value
setsaturation('object','value');
Example:
x3d(welcomeimg).setsaturation = 0.85
setsaturation('welcomeimg',0.85);
Values that are allowed are: between -1 and 1 OR -100 and 100.
Returns:
object or 'error



Function name:

setbrightness



Function description:
Places a filter above an object / image that changes its brightness.

Function structure:
x3d(object).setbrightness = value
setbrightness('object','value');
Example:
x3d(welcomeimg).setbrightness= 0.85
setbrightness('welcomeimg',0.85);
Values that are allowed are: between -1 and 1 OR -100 and 100.
Returns:
object or 'error




Function name:

setgamma



Function description:
Changes the gamma (Red, Green, Blue) of an image.

Function structure:
x3d(object).setgamma= value
setgamma('object','value');
Example:
x3d(welcomeimg).setgamma= 256,0,31
setgamma('welcomeimg','256,0,31');
Values that are allowed are: between 0 and 256.
Values must be written in 'string literals': '256,current,|'
Value must consist of 3 values; Red, Green, Blue. If you wish to only change 1 value for example green you can use 'current' or '|'. Example:
'256,current,34'.
Returns:
object or 'error



Retrieving object / image properties

These functions 'get' a property of the object / image, they return this property and could thus be used for testing or to fill variables for example.


Function name:

getproperty



Function description:
Gets the chosen property (value) of the object / image.

Function structure:
x3d(object).getproperty = value
getproperty('object','value');

Example:
x3d(welcomeimg).getproperty = top
getproperty('welcomeimg','top');
The value is the property you wish to retrieve.

Returns:
propertyvalue



Function name:

getx



Function description:
Gets the x-axle value from the object / image.

Function structure:
x3d(object).getx = value
getx('object');

Example:
x3d(welcomeimg).getx = 1
getx('welcomeimg');
To use this function through the outputscript, you only need to enter an object(id).
To use this function through the rules, you must enter a value of either 1 or 0.
Note: This function returns the value of which the object resides in at that moment and time, if the object is in animation this might not be the end position.

Returns:
x (left) value



Function name:

gety



Function description:
Gets the y-axle value from the object / image.

Function structure:
x3d(object).gety = value
gety('object');

Example:
x3d(welcomeimg).gety = 1
gety('welcomeimg');
To use this function through the outputscript, you only need to enter an object(id).
To use this function through the rules, you must enter a value of either 1 or 0.
Note: This function returns the value of which the object resides in at that moment and time, if the object is in animation this might not be the end position.

Returns:
y (top) value



Function name:

getz



Function description:
Gets the layer on which the object / images resides.

Function structure:
x3d(object).getz = value
getz('object');

Example:
x3d(welcomeimg).getz = 1
getz('welcomeimg');
To use this function through the outputscript, you only need to enter an object(id).
To use this function through the rules, you must enter a value of either 1 or 0.

Returns:
z (layer) value



Function name:

getscale



Function description:
Gets the objects scale (X&Y combined)

Function structure:
x3d(object).getscale = value
getscale('object');

Example:
x3d(welcomeimg).getscale = 1
getscale('welcomeimg');
To use this function through the outputscript, you only need to enter an object(id).
To use this function through the rules, you must enter a value of either 1 or 0.

Returns:
scale (x&y) value



Function name:

getscalex



Function description:
Gets the objects x-axle scale.

Function structure:
x3d(object).getscalex = value
getscalex('object');

Example:
x3d(welcomeimg).getscalex = 1
getscalex('welcomeimg'):
To use this function through the outputscript, you only need to enter an object(id).
To use this function through the rules, you must enter a value of either 1 or 0.

Returns:
scalex value



Function name:

getscaley



Function description:
Gets the objects y-axle scale.

Function structure:
x3d(object).getscaley = value
getscaley('object');

Example:
x3d(welcomeimg).getscaley = 1
getscaley('welcomeimg');
To use this function through the outputscript, you only need to enter an object(id).
To use this function through the rules, you must enter a value of either 1 or 0.

Returns:
scaley value



Function name:

getfilter



Function description:
Gets the objects filter.

Function structure:
x3d(object).getfilter = filtername
getfilter('object', 'filtername');

Example:
x3d(welcomeimg).getfilter = rotation
getfilter('welcomeimg','rotation');

Returns:
filter



Function name:

getfilterindex



Function description:
Gets the index of an objects' filter.

Function structure:
x3d(object).getfilterindex = filtername
getfilterindex('object', 'filtername');

Example:
x3d(welcomeimg).getfilterindex = 'rotation'
getfilterindex('welcomeimg', 'rotation');

Returns:
filter index



Other functions

These functions don't add/alter objects / images.
They are classified as 'other' functions for this reason.


Function name:

copy



Function description:
Copies the chosen object / image and gives it a new id.

Function structure:
x3d(object).copy = value
copy('object','value');

Example:
x3d(welcomeimg).copy = newimage
copy('welcomeimg','newimage');
The new id (value) must be unique. (can't already exist)
Note: When copying an object/image the new object/image will be placed ontop of the copied object/image.

Returns:
cloned object or 'error'



Function name:

delete/deletethis



Function description:
Deletes the chosen object / image from the canvas.

Function structure:
x3d(object).delete = value
deletethis('object');

Example:
x3d(newimage).delete = 1
deletethis('newimage');
If you wish to use this function in the outputscript you must use 'deletethis' otherwise an error will occur.
Using this function in the rules works with both 'delete' and 'deletethis'.
To use this function through the outputscript, you only need to enter an object(id).
To use this function through the rules, you must enter a value of either 1 or 0.

Returns:
'success' or 'error'




Function name:

clearcanvas



Function description:
Removes all objects and images from the canvas.

Function structure:
x3d(object).clearcanvas = value
clearcanvas('object');

Example:
x3d(c).clearcanvas = 1
clearcanvas('c');
To use this function through the outputscript, you only need to enter an object(id).
To use this function through the rules, you must enter a value of either 1 or 0.
The object(id) in this case is that of the canvas.

Returns:
canvas or 'error'



Function name:

screenshot



Function description:
Makes a screenshot of the chosen canvas.

Function structure:
x3d(object).screenshot = value
screenshot('object');

Example:
x3d(c).screenshot = 1
screenshot('c');
To use this function through the outputscript, you only need to enter an object(id).
To use this function through the rules, you must enter a value of either 1 or 0.
The object(id) in this case is that of the canvas.

Returns:
screenshot name or 'error'



Function name:

saveconfig



Function description:
Saves the canvas(ses) data to the server.

Function structure:
x3d(savename).saveconfig = names of canvas(ses) to save
saveconfig('savename','names of canvas(ses) to save';

Example:
x3d(firstdesign).saveconfig = firstcanvas,secondcanvas
saveconfig('firstdesign', 'firstcanvas,secondcanvas');
When no canvas(ses) are chosen, every canvas will get saved.
Returns:
data (log) temporary



Function name:

buildconfig



Function description:
Loads the content from the server into the canvas(ses).

Function structure:
x3d(savename).buildconfig = firstcanvas, secondcanvas
buildconfig('savename', 'firstcanvas,secondcanvas');

Example:
x3d(firstdesign).buildconfig= 1
buildconfig('firstdesign');
To use this function use 'saveconfig' first, make sure the view (savename) is the same as the name used in 'saveconfig' (case sensitive).
Returns:
'succes' (temporary)