Widget Namespace.
- Mixes In:
- Source:
Methods
-
<static> circularConstraint(dyn_object, widget)
-
The
circularConstraintwidget creates circular constraints.A circular constraint is a special kind of constraint that is made up of an object
dyn_objectand a point(x,y)in space.The object rotates around the centroid of
dyn_objectas it rotates around the point(x,y).Parameters:
Name Type Description dyn_objectPhSim.DynObject widgetObject Circular Constraint options
Properties
Name Type Description xNumber x-coordinate of the other end of the constraint
yNumber y-coordinate of the other end of the constraint
- Source:
-
<static> clone(dyn_object, widget)
-
The
clonewidget is a widget that makes copies of an object and inserts them into the simulation.Parameters:
Name Type Description dyn_objectPhSim.DynObject widgetWFunctionOptions Options.
- Source:
-
<static> constraint(phsim, widget)
-
Constraint Widget
Parameters:
Name Type Description phsimPhSim widgetObject Widget Options
Properties
Name Type Argument Default Description objectALOAddress | PhSim.DynObject <optional>
Object A - First point.
objectBLOAddress | PhSim.DynObject <optional>
Object B - Second Point
pointAVector <optional>
First point (see
widget.positionfor more information)pointBVector <optional>
Second point (see
widget.positionfor more information)position"relative" | "absolute" <optional>
"absolute" Positions of points.
If set to
"relative", then the rules for positioning a point is the following:-
If
widget.objectAis set, thenwidget.pointAdefines the offset from the centroid ofwidget.objectA. Otherwise, the point is set to a point in the phsim space. -
If
widget.objectBis set, thenwidget.pointBdefines the offset from the centroid ofwidget.objectB. Otherwise, the point is set to a point in the phsim space.
Note: If one is familar with Matter.js, then the rules are simular to rules of making a constraint are simular to those in Matter.js.
If set to
"absolute", then the rules for positioning a point is that the points are set to points in space. This is the default value.- Source:
-
-
<static> deleteSelf(dyn_object, widget)
-
The deleteSelf widget makes an object delete itself from the simulation.
Parameters:
Name Type Description dyn_objectPhSim.DynObject The Dynamic Object to be configured.
widgetWFunctionOptions Configuration options
- Source:
-
<static> draggable(dyn_object, widget)
-
The
draggablewidget makes PhSim.DynObject objects draggable.This:
Parameters:
Name Type Description dyn_objectPhSim.DynObject widget* - Source:
-
<static> elevator(dyn_object, widget)
-
The
elevatorwidget makes objects go back and forth within some range.Parameters:
Name Type Description dyn_objectPhSim.DynObject widgetObject Options
Properties
Name Type Description pointAVector First point of the elevator
pointBVector Second point of the elevator
bounding"x" | "y" Rules for deteriming the range of the elevator.
If
widget.boundingis equal to"x", then the elevator switches direction if thexvalue of the position ofdyn_objectis equal towidget.pointA.xorwidget.pointB.x.If
widget.boundingis equal to"y", then the elevator switches direction if theyvalue of the position ofdyn_objectis equal towidget.pointA.yorwidget.pointB.y.- Source:
-
<static> force(dyn_object, widget)
-
The
forcewidget exerts a force on an objectParameters:
Name Type Description dyn_objectPhSim.DynObject widgetWFunctionOptions - Source:
-
<static> noRotation(dyn_object, widget)
-
Make object not rotate
Parameters:
Name Type Description dyn_objectPhSim.DynObject widget* - Source:
-
<static> objLink(dyn_object, widget)
-
The
objLinkwidget executes all functions in the PhSim.DynObject#objLinkFunctions array ofwidget.target.Parameters:
Name Type Description dyn_objectPhSim.DynObject Reciever Object
widgetWFunctionOptions Widget options
Properties
Name Type Description targetLOAddress | PhSim.DynObject Target object
- Source:
-
<static> playAudio(dyn_object, widget)
-
PlayAudio Widget
This:
Parameters:
Name Type Description dyn_objectPhSim.DynObject widgetObject - Source:
-
<static> position(dynObject, widget)
-
The
positionwidget sets the position of an object.This:
- {PhSim}
Parameters:
Name Type Description dynObjectPhSim.DynObject Dynamic object that will have its position changed.
widgetWFunctionOptions Widget options.
- Source:
-
<static> rectText(dyn_object)
-
Widget that sets the PhSim.DynObject#rectTextWidget as true.
Parameters:
Name Type Description dyn_objectPhSim.DynObject - Source:
-
<static> rotation(dynObject, widget)
-
The
rotationwidget rotates an object.This:
- {PhSim}
Parameters:
Name Type Description dynObjectPhSim.DynObject widgetWFunctionOptions - Source:
-
<static> setAngle(dynObject, widget)
-
The
setAnglewidget makes a widget change angle.Parameters:
Name Type Description dynObjectPhSim.DynObject Dynamic Object
widgetWFunctionOptions - Source:
-
<static> setBorderColor(dyn_object, widget)
-
The
setBorderColorwidget sets the border color of an object.Parameters:
Name Type Description dyn_objectPhSim.DynObject widgetWFunctionOptions Widget properties.
Properties
Name Type Description colorString The new color of the object border
- Source:
-
<static> setColor(dyn_object, widget)
-
The
setColorwidget changes the color of an object. It utlizies the PhSim.DynObject.setColor function.Parameters:
Name Type Description dyn_objectPhSim.DynObject Dynamic Object that will have it's color changed.
widgetWFunctionOptions Widget Options
Properties
Name Type Description colorString The new color of the object.
- Source:
-
<static> setLineWidth(dyn_object, widget)
-
The
setLineWidthwidget sets the line width of an object.Parameters:
Name Type Description dyn_objectPhSim.DynObject The object to be affected.
widgetWFunctionOptions Widget options
Properties
Name Type Description widthNumber New line width
- Source:
-
<static> stack(o, w)
-
This:
- {PhSim}
Parameters:
Name Type Description oDynSimObject wObject Widget Options
Properties
Name Type Description rowsNumber Widget Rows
rowDistNumber Distance between two adjacent objects in a row
columnsNumber Columns
colDistNumber Distance between two adjecent objects in the column
- Source:
-
<static> toggleLock(dyn_object, widget)
-
The
toggleLockwidget toggles the lock status of the Dynamic Object. If locked, the object is unlocked. If unlocked, the object is locked.Parameters:
Name Type Description dyn_objectPhSim.DynObject widgetWFunctionOptions Configuration
- Source:
-
<static> toggleSemiLock(dyn_object, widget)
-
The
toggleSemiLockwidget toggles the semi-lock status of the Dynamic Object. If semi-locked, the object is semi-unlocked. If semi-unlocked, the object is semi-locked.Parameters:
Name Type Description dyn_objectPhSim.DynObject widgetWFunctionOptions Configuration
- Source:
-
<static> transformCameraByObj(dyn_object)
-
The
transformCameraByObjwidget transforms the camera by an object.This:
Parameters:
Name Type Description dyn_objectPhSim.DynObject Object that will transform object.
- Source:
-
<static> translate(dynObject, widget)
-
The
translatewidget moves objects.This:
- {PhSim}
Parameters:
Name Type Description dynObjectPhSim.DynObject Dynamic Object to be translated.
widgetWFunctionOptions Widget options.
Properties
Name Type Description vectorVector Translation vector
- Source:
-
<static> velocity(dynObject, widget)
-
The
velocitywidget makes dynamic objects go at a certain velocity.This:
- {PhSim}
Parameters:
Name Type Description dynObjectPhSim.DynObject widgetWFunctionOptions Properties
Name Type Description vectorVector Velocity vector
- Source:
-
<static> wFunction(o, widget)
-
The
wFunctionwidget is used to create wFunctions.Parameters:
Name Type Description oPhSim.DynObject | PhSim Target object or simulation
widgetWFunctionOptions wFunction options
- Source: