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

From QmazeWiki
Jump to: navigation, search
(setgamma)
 
(30 intermediate revisions by the same user not shown)
Line 9: Line 9:
 
<br />
 
<br />
 
<br/><br/>
 
<br/><br/>
==='''Adding / Altering (existing) objects / images:'''===
+
==='''Adding / altering (existent) objects / images:'''===
 
These functions can be used to add objects / images to the canvas. <br />
 
These functions can be used to add objects / images to the canvas. <br />
 
If objects already exist they will be altered.<br />
 
If objects already exist they will be altered.<br />
Line 52: Line 52:
 
<br />
 
<br />
 
Returns:<br />
 
Returns:<br />
add: text value <br />
+
add: object<br />
alter: 'succes' or 'error'<br />
+
alter: object or 'error'<br />
  
 
<br /><br />
 
<br /><br />
Line 72: Line 72:
 
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 />
 
<br />
 
Returns:<br />
 
Returns:<br />
add: image (object) <br />
+
add: object<br />
alter: 'succes' or 'error'<br />
+
alter: object or 'error'<br />
  
 
<br /><br />
 
<br /><br />
  
 
Function name:<br />
 
Function name:<br />
 +
 
===='''setbgimg'''====
 
===='''setbgimg'''====
 
<br /><br />
 
<br /><br />
Line 98: Line 100:
 
<br />
 
<br />
 
Returns:<br />
 
Returns:<br />
bgimg (object) <br />
+
object <br />
  
 
<br /><br />
 
<br /><br />
Line 119: Line 121:
 
<br />
 
<br />
 
Returns:<br />
 
Returns:<br />
add: rectangle (object)<br />
+
add: object<br />
alter: rectangle (object) or 'error'<br />
+
alter: object or 'error'<br />
  
 
<br /><br />
 
<br /><br />
Line 141: Line 143:
 
<br />
 
<br />
 
Returns:<br />
 
Returns:<br />
add: rectangle (object)<br />
+
add: object<br />
alter: rectangle (object) or 'error'<br />
+
alter: object or 'error'<br />
  
 
<br /><br />
 
<br /><br />
Line 163: Line 165:
 
<br />
 
<br />
 
Returns:<br />
 
Returns:<br />
add: triangle(object)<br />
+
add: object<br />
alter: triangle(object) or 'error'<br />
+
alter: object or 'error'<br />
  
 
<br /><br />
 
<br /><br />
Line 186: Line 188:
 
<br />
 
<br />
 
Returns:<br />
 
Returns:<br />
add: polygon(object)<br />
+
add: object<br />
alter: polygon(object) or 'error'<br />
+
alter: object or 'error'<br />
  
 
<br /><br />
 
<br /><br />
Line 208: Line 210:
 
<br />
 
<br />
 
Returns:<br />
 
Returns:<br />
'succes' or 'error'<br />
+
object(s) or 'error'<br />
  
 
<br /><br />
 
<br /><br />
Line 229: Line 231:
 
<br />
 
<br />
 
Returns:<br />
 
Returns:<br />
'succes' or 'error'<br />
+
object(s) or 'error'<br />
  
 
<br /><br />
 
<br /><br />
Line 250: Line 252:
 
<br />
 
<br />
 
Returns:<br />
 
Returns:<br />
'succes' or 'error'<br />
+
object or 'error'<br />
  
 
<br /><br />
 
<br /><br />
Line 275: Line 277:
 
<br />
 
<br />
 
Returns:<br />
 
Returns:<br />
'succes' or 'error'<br />
+
object or 'error'<br />
  
 
<br /><br />
 
<br /><br />
Line 296: Line 298:
 
<br />
 
<br />
 
Returns:<br />
 
Returns:<br />
'succes' or 'error'<br />
+
object or 'error'<br />
  
 
<br /><br />
 
<br /><br />
Line 317: Line 319:
 
<br />
 
<br />
 
Returns:<br />
 
Returns:<br />
'succes' or 'error'<br />
+
animation duration or 'error'<br />
  
 
<br /><br />
 
<br /><br />
Line 338: Line 340:
 
<br />
 
<br />
 
Returns:<br />
 
Returns:<br />
'succes' or 'error'<br />
+
animation name or 'error'<br />
  
 
<br /><br />
 
<br /><br />
Line 358: Line 360:
 
<br />
 
<br />
 
Returns:<br />
 
Returns:<br />
'succes' or 'error'<br />
+
object or 'error'<br />
  
 
<br /><br />
 
<br /><br />
Line 380: Line 382:
 
<br />
 
<br />
 
Returns:<br />
 
Returns:<br />
'succes' or 'error'<br />
+
object or 'error'<br />
  
 
<br /><br />
 
<br /><br />
Line 400: Line 402:
 
<br />
 
<br />
 
Returns:<br />
 
Returns:<br />
'succes' or 'error'<br />
+
object or 'error'<br />
  
 
<br /><br />
 
<br /><br />
Line 420: Line 422:
 
<br />
 
<br />
 
Returns:<br />
 
Returns:<br />
'succes' or 'error'<br />
+
object or 'error'<br />
 
 
 
<br /><br />
 
<br /><br />
Line 442: Line 444:
 
<br />
 
<br />
 
Returns:<br />
 
Returns:<br />
'succes' or 'error'<br />
+
object or 'error'<br />
 
 
 
<br /><br />
 
<br /><br />
Line 464: Line 466:
 
<br />
 
<br />
 
Returns:<br />
 
Returns:<br />
'succes' or 'error'<br />
+
object or 'error'<br />
  
 
<br /><br />
 
<br /><br />
Line 484: Line 486:
 
<br />
 
<br />
 
Returns:<br />
 
Returns:<br />
'succes' or 'error'<br />
+
object or 'error'<br />
 
 
 
<br /><br />
 
<br /><br />
Line 507: Line 509:
 
<br />
 
<br />
 
Returns:<br />
 
Returns:<br />
'succes' or 'error'<br />
+
object or 'error'<br />
  
 
<br /><br />
 
<br /><br />
Line 531: Line 533:
 
<br />
 
<br />
 
Returns:<br />
 
Returns:<br />
'succes' or 'error'<br />
+
object or 'error'<br />
  
 
<br /><br />
 
<br /><br />
Line 555: Line 557:
 
<br />
 
<br />
 
Returns:<br />
 
Returns:<br />
'succes' or 'error'<br />
+
object or 'error'<br />
  
 
<br /><br />
 
<br /><br />
Line 577: Line 579:
 
<br />
 
<br />
 
Returns:<br />
 
Returns:<br />
'succes' or 'error'<br />
+
object or 'error'<br />
  
 
<br /><br />
 
<br /><br />
Line 598: Line 600:
 
<br />
 
<br />
 
Returns:<br />
 
Returns:<br />
'succes' or 'error'<br />
+
object or 'error'<br />
  
 
<br /><br />
 
<br /><br />
Line 619: Line 621:
 
<br />
 
<br />
 
Returns:<br />
 
Returns:<br />
'succes' or 'error'<br />
+
object or 'error'<br />
 
 
 
<br /><br />
 
<br /><br />
Line 641: Line 643:
 
<br />
 
<br />
 
Returns:<br />
 
Returns:<br />
'succes' or 'error'<br />
+
object or 'error'<br />
  
 
<br /><br />
 
<br /><br />
Line 662: Line 664:
 
<br />
 
<br />
 
Returns:<br />
 
Returns:<br />
'succes' or 'error'<br />
+
object or 'error'<br />
  
 
<br /><br />
 
<br /><br />
Line 683: Line 685:
 
<br />
 
<br />
 
Returns:<br />
 
Returns:<br />
'succes' or 'error'<br />
+
object or 'error'<br />
  
 
<br /><br />
 
<br /><br />
Line 706: Line 708:
 
<br />
 
<br />
 
Returns:<br />
 
Returns:<br />
'succes' or 'error'<br />
+
object or 'error'<br />
  
 
<br /><br />
 
<br /><br />
Line 728: Line 730:
 
<br />
 
<br />
 
Returns:<br />
 
Returns:<br />
'succes' or 'error'<br />
+
object or 'error'<br />
  
 
<br /><br />
 
<br /><br />
Line 750: Line 752:
 
<br />
 
<br />
 
Returns:<br />
 
Returns:<br />
'succes' or 'error'<br />
+
object or 'error'<br />
 
 
 
<br /><br />
 
<br /><br />
Line 772: Line 774:
 
<br />
 
<br />
 
Returns:<br />
 
Returns:<br />
'succes' or 'error'<br />
+
default properties or 'error'<br />
 +
 
 +
<br /><br />
 +
 
 +
Function name: <br />
 +
===='''setcornersize'''====
 +
<br />
 +
<br />
 +
Function description: <br />
 +
Changes the size of the handle corners.<br />
 +
<br />
 +
Function structure: <br />
 +
x3d(object).setcornersize = value<br />
 +
setcornersize('object','value');
 +
<br />
 +
Example: <br />
 +
x3d(welcomeimg).setcornersize = 8<br />
 +
setcornersize('welcomeimg',8);<br />
 +
<br />
 +
Returns:<br />
 +
object or 'error'<br />
 +
 
 +
<br /><br />
 +
 
 +
Function name: <br />
 +
===='''setcornercolor'''====
 +
<br />
 +
<br />
 +
Function description: <br />
 +
Changes the color of the handle corners.<br />
 +
<br />
 +
Function structure: <br />
 +
x3d(object).setcornercolor = value<br />
 +
setcornercolor('object','value');
 +
<br />
 +
Example: <br />
 +
x3d(welcomeimg).setcornercolor = Red<br />
 +
setcornercolor('welcomeimg','Red');<br />
 +
<br />
 +
Returns:<br />
 +
object or 'error'<br />
 +
 
 +
<br /><br />
 +
 
 +
Function name: <br />
 +
===='''setbordercolor'''====
 +
<br />
 +
<br />
 +
Function description: <br />
 +
Changes the color of the handle line.<br />
 +
<br />
 +
Function structure: <br />
 +
x3d(object).setbordercolor = value<br />
 +
setbordercolor('object','value');
 +
<br />
 +
Example: <br />
 +
x3d(welcomeimg).setbordercolor = Red<br />
 +
setbordercolor('welcomeimg','Red');<br />
 +
<br />
 +
Returns:<br />
 +
object or 'error'<br />
 +
 
 +
<br /><br />
 +
 
 +
Function name: <br />
 +
===='''settransparentcorners'''====
 +
<br />
 +
<br />
 +
Function description: <br />
 +
Changes the transparancy of the handle corners.<br />
 +
<br />
 +
Function structure: <br />
 +
x3d(object).settransparentborders = value<br />
 +
settransparentborders('object','value');
 +
<br />
 +
Example: <br />
 +
x3d(welcomeimg).settransparentborders = true<br />
 +
settransparentborders('welcomeimg',true);<br />
 +
<br />
 +
Returns:<br />
 +
object or 'error'<br />
 +
 
 +
<br /><br />
 +
 
 +
Function name: <br />
 +
===='''setgroup'''====
 +
<br />
 +
<br />
 +
Function description: <br />
 +
Wraps a fabric group element around one or more object(s).<br />
 +
<br />
 +
Function structure: <br />
 +
x3d(group).setgroup = object(s)<br />
 +
setgroup('group','object(s)');
 +
<br />
 +
Example: <br />
 +
x3d(welcomegroup).setgroup = welcometext, welcomeimg, welcomesign<br />
 +
setgroup('welcomegroup','welcometext,welcomeimg,welcomesign');<br />
 +
<br />
 +
Returns:<br />
 +
group or 'error'<br />
 +
 
 +
<br /><br />
 +
 
 +
Function name: <br />
 +
===='''settextpattern'''====
 +
<br />
 +
<br />
 +
Function description: <br />
 +
Lays a (image) pattern over a text object. <br />
 +
<br />
 +
Function structure: <br />
 +
x3d(object).settextpattern = src/url<br />
 +
settextpattern('object','src/url');
 +
<br />
 +
Example: <br />
 +
x3d(welcometext).settextpattern = Images/pineapples.png<br />
 +
settextpattern('welcometext','Images/pineapples.png');<br />
 +
<br />
 +
Returns:<br />
 +
object or 'error'<br />
 +
 
 +
<br /><br />
 +
 
 +
Function name: <br />
 +
===='''ungroup'''====
 +
<br />
 +
<br />
 +
Function description: <br />
 +
Removes an already existent group from the canvas. <br />
 +
<br />
 +
Function structure: <br />
 +
x3d(group).ungroup = value<br />
 +
ungroup('group','value');
 +
<br />
 +
Example: <br />
 +
x3d(welcomegroup).ungroup = 1<br />
 +
ungroup('welcomegroup',1);<br />
 +
<br />
 +
Returns:<br />
 +
group or 'error'<br />
 +
 
 +
<br /><br />
 +
 
 +
Function name: <br />
 +
===='''setdraganddrop'''====
 +
<br />
 +
<br />
 +
Function description: <br />
 +
Enables/disables html image drag and drop onto the canvas. <br />
 +
<br />
 +
Function structure: <br />
 +
x3d().setdraganddrop = value<br />
 +
setdraganddrop('','value');
 +
<br />
 +
Example: <br />
 +
x3d().setdraganddrop = true <br />
 +
setdraganddrop('',true);<br />
 +
Only images with the property: " draggable = 'true' " are draggable onto the canvas.<br />
 +
<br />
 +
Returns:<br />
 +
draggable images or 'error'<br />
 +
 
 +
<br /><br />
 +
 
 +
Function name: <br />
 +
===='''sethue'''====
 +
<br />
 +
<br />
 +
Function description: <br />
 +
Places a filter above an object / image that changes its hue vibrance.<br />
 +
<br />
 +
Function structure: <br />
 +
x3d(object).sethue = value<br />
 +
sethue ('object','value');
 +
<br />
 +
Example: <br />
 +
x3d(welcomeimg).sethue = 0.85<br />
 +
sethue ('welcomeimg',0.85);<br />
 +
Values that are allowed are: between -1 and 1 OR -100 and 100.
 +
<br />
 +
Returns:<br />
 +
object or 'error <br />
 +
 
 +
<br /><br />
 +
 
 +
Function name: <br />
 +
===='''setsaturation'''====
 +
<br />
 +
<br />
 +
Function description: <br />
 +
Places a filter above an object / image that changes its saturation.<br />
 +
<br />
 +
Function structure: <br />
 +
x3d(object).setsaturation= value<br />
 +
setsaturation('object','value');
 +
<br />
 +
Example: <br />
 +
x3d(welcomeimg).setsaturation = 0.85<br />
 +
setsaturation('welcomeimg',0.85);<br />
 +
Values that are allowed are: between -1 and 1 OR -100 and 100.
 +
<br />
 +
Returns:<br />
 +
object or 'error <br />
 +
 
 +
<br /><br />
 +
 
 +
Function name: <br />
 +
===='''setbrightness'''====
 +
<br />
 +
<br />
 +
Function description: <br />
 +
Places a filter above an object / image that changes its brightness.<br />
 +
<br />
 +
Function structure: <br />
 +
x3d(object).setbrightness = value<br />
 +
setbrightness('object','value');
 +
<br />
 +
Example: <br />
 +
x3d(welcomeimg).setbrightness= 0.85<br />
 +
setbrightness('welcomeimg',0.85);<br />
 +
Values that are allowed are: between -1 and 1 OR -100 and 100.
 +
<br />
 +
Returns:<br />
 +
object or 'error <br />
 +
 
 +
<br /><br />
 +
 
 +
 
 +
Function name: <br />
 +
===='''setgamma'''====
 +
<br />
 +
<br />
 +
Function description: <br />
 +
Changes the gamma (Red, Green, Blue) of an image.<br />
 +
<br />
 +
Function structure: <br />
 +
x3d(object).setgamma= value<br />
 +
setgamma('object','value');
 +
<br />
 +
Example: <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 />
Line 809: Line 1,060:
 
<br />
 
<br />
 
Function structure: <br />
 
Function structure: <br />
x3d(object).getx<br />
+
x3d(object).getx = value<br />
 
getx('object');<br />
 
getx('object');<br />
 
<br />
 
<br />
 
Example: <br />
 
Example: <br />
x3d(welcomeimg).getx<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 />
 
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 />
 
<br />
Line 830: Line 1,083:
 
<br />
 
<br />
 
Function structure: <br />
 
Function structure: <br />
x3d(object).gety<br />
+
x3d(object).gety = value<br />
 
gety('object');<br />
 
gety('object');<br />
 
<br />
 
<br />
 
Example: <br />
 
Example: <br />
x3d(welcomeimg).gety<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 />
 
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 />
 
<br />
Line 851: Line 1,106:
 
<br />
 
<br />
 
Function structure: <br />
 
Function structure: <br />
x3d(object).getz<br />
+
x3d(object).getz = value<br />
 
getz('object');<br />
 
getz('object');<br />
 
<br />
 
<br />
 
Example: <br />
 
Example: <br />
x3d(welcomeimg).getz<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 />
 
<br />
 
Returns:<br />
 
Returns:<br />
Line 871: Line 1,128:
 
<br />
 
<br />
 
Function structure: <br />
 
Function structure: <br />
x3d(object).getscale<br />
+
x3d(object).getscale = value<br />
 
getscale('object');<br />
 
getscale('object');<br />
 
<br />
 
<br />
 
Example: <br />
 
Example: <br />
x3d(welcomeimg).getscale<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 />
 
<br />
 
Returns:<br />
 
Returns:<br />
Line 891: Line 1,150:
 
<br />
 
<br />
 
Function structure: <br />
 
Function structure: <br />
x3d(object).getscalex<br />
+
x3d(object).getscalex = value<br />
 
getscalex('object');<br />
 
getscalex('object');<br />
 
<br />
 
<br />
 
Example: <br />
 
Example: <br />
x3d(welcomeimg).getscalex<br />
+
x3d(welcomeimg).getscalex = 1<br />
 
getscalex('welcomeimg'):<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 />
 
<br />
 
Returns:<br />
 
Returns:<br />
Line 911: Line 1,172:
 
<br />
 
<br />
 
Function structure: <br />
 
Function structure: <br />
x3d(object).getscaley<br />
+
x3d(object).getscaley = value<br />
 
getscaley('object');<br />
 
getscaley('object');<br />
 
<br />
 
<br />
 
Example: <br />
 
Example: <br />
x3d(welcomeimg).getscaley<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 />
 
<br />
 
Returns:<br />
 
Returns:<br />
 
scaley value<br />
 
scaley value<br />
 +
 +
<br /><br />
 +
 +
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 />
 
<br /><br />
Line 946: Line 1,249:
 
<br />
 
<br />
 
Returns:<br />
 
Returns:<br />
cloned object (object) or 'error'<br />
+
cloned object or 'error'<br />
 
 
 
<br /><br />
 
<br /><br />
Line 959: Line 1,262:
 
<br />
 
<br />
 
Function structure: <br />
 
Function structure: <br />
x3d(object).delete<br />
+
x3d(object).delete = value<br />
 
deletethis('object');<br />
 
deletethis('object');<br />
 
<br />
 
<br />
 
Example: <br />
 
Example: <br />
x3d(newimage).delete<br />
+
x3d(newimage).delete = 1<br />
 
deletethis('newimage');<br />
 
deletethis('newimage');<br />
 
If you wish to use this function in the outputscript you must use 'deletethis' otherwise an error will occur.<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 />
 
Using this function in the rules works with both 'delete' and 'deletethis'.<br />
To use this function, you only need to enter an 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 />
 
<br />
 
<br />
 
Returns:<br />
 
Returns:<br />
'succes' or 'error'<br />
+
'success' or 'error'<br />
  
  
Line 984: Line 1,288:
 
<br />
 
<br />
 
Function structure: <br />
 
Function structure: <br />
x3d(object).clearcanvas<br />
+
x3d(object).clearcanvas = value<br />
 
clearcanvas('object');<br />
 
clearcanvas('object');<br />
 
<br />
 
<br />
 
Example: <br />
 
Example: <br />
x3d(c).clearcanvas<br />
+
x3d(c).clearcanvas = 1<br />
 
clearcanvas('c');<br />
 
clearcanvas('c');<br />
To use this function, you only need to enter an 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 />
 
<br />
 
Returns:<br />
 
Returns:<br />
'succes' or 'error'<br />
+
canvas or 'error'<br />
 
 
 
<br /><br />
 
<br /><br />
Line 1,006: Line 1,311:
 
<br />
 
<br />
 
Function structure: <br />
 
Function structure: <br />
x3d(object).screenshot<br />
+
x3d(object).screenshot = value<br />
 
screenshot('object');<br />
 
screenshot('object');<br />
 
<br />
 
<br />
 
Example: <br />
 
Example: <br />
x3d(c).screenshot<br />
+
x3d(c).screenshot = 1<br />
 
screenshot('c');<br />
 
screenshot('c');<br />
To use this function, you only need to enter an 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 />
 
<br />
 
Returns:<br />
 
Returns:<br />
'succes' or 'error'<br />
+
screenshot name or 'error'<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)