class UI3DViewer
Object for embedding a 3D view in a UI.
class UI3DViewer
| Name | Description |
|---|---|
| Constructors | |
| UI3DViewer() | Creates a new UI3DViewer. |
| Properties | |
| block | The block element to which this ui-3dviewer belongs. |
| origin | A Vector2 representing the ui-3dviewer’s position. |
| size | A Vector2 representing the ui-3dviewer’s size. |
| onRender | Callback function triggered by UIManager during UI rendering. |
| onMouseDown | Callback function passed by UIManager during UI input handling. |
| onMouseUp | Callback function passed by UIManager during UI input handling. |
| onMouseMove | Callback function passed by UIManager during UI input handling. |
| onMouseWheel | Callback function passed by UIManager during UI input handling. |
| onTouchDown | Callback function passed by UIManager during UI input handling. |
| onTouchUp | Callback function passed by UIManager during UI input handling. |
| onTouchMove | Callback function passed by UIManager during UI input handling. |
| Methods | |
| dispose() | Dispose the unmanaged resource. |
| getOrigin() | Get the value of .origin |
| setOrigin() | Set the value of .origin |
| getSize() | Get the value of .size |
| setSize() | Set the value of .size |
Constructors
UI3DViewer()
UI3DViewer()
Creates a new UI3DViewer.
Properties
block
.block: UIBlock
The block element to which this ui-3dviewer belongs.
When there is a valid block element, this ui-3dviewer is translated and clipped according the its block element.
Readable and writable.
Default is null.
origin
.origin: Object
A Vector2 representing the ui-3dviewer’s position.
Read-only. Use method setOrigin() to modify this property.
Default is {x: 0, y: 0}.
onRender
.onRender: Function
Callback function triggered by UIManager during UI rendering.
Signature: onRender(width: Number, height: Number, size_changed: Boolean):undefined
Readable and writable.
Default is null.
onMouseDown
.onMouseDown: Function
Callback function passed by UIManager during UI input handling.
Signature: onMouseDown(e: Object): undefined
The parameter e has the same structure as in the global callback OnMouseDown()
Readable and writable.
Default is null.
onMouseUp
.onMouseUp: Function
Callback function passed by UIManager during UI input handling.
Signature: onMouseUp(e: Object): undefined
The parameter e has the same structure as in the global callback OnMouseDown()
Readable and writable.
Default is null.
onMouseMove
.onMouseMove: Function
Callback function passed by UIManager during UI input handling.
Signature: onMouseMove(e: Object): undefined
The parameter e has the same structure as in the global callback OnMouseDown()
Readable and writable.
Default is null.
onMouseWheel
.onMouseWheel: Function
Callback function passed by UIManager during UI input handling.
Signature: onMouseWheel(e: Object): undefined
The parameter e has the same structure as in the global callback OnMouseDown()
Readable and writable.
Default is null.
onTouchDown
.onTouchDown: Function
Callback function passed by UIManager during UI input handling.
Signature: onTouchDown(e: Object): undefined
The parameter e has the same structure as in the global callback OnTouchDown()
Readable and writable.
Default is null.
onTouchUp
.onTouchUp: Function
Callback function passed by UIManager during UI input handling.
Signature: onTouchUp(e: Object): undefined
The parameter e has the same structure as in the global callback OnTouchDown()
Readable and writable.
Default is null.
onTouchMove
.onTouchMove: Function
Callback function passed by UIManager during UI input handling.
Signature: onTouchMove(e: Object): undefined
The parameter e has the same structure as in the global callback OnTouchDown()
Readable and writable.
Default is null.
Methods
dispose()
.dispose(): undefined
Dispose the unmanaged resource.
getOrigin()
.getOrigin(vector: Vector2): Vector2
Copy the value of .origin into vector.
setOrigin()
.setOrigin(vector: Vector2): undefined
Set the value of .origin according to vector.
.setOrigin(x: Number, y: Number ): undefined
Set the value of .origin according to the x, y coordinates.
getSize()
.getSize(vector: Vector2): Vector2
Copy the value of .size into vector.
setSize()
.setSize(vector: Vector2): undefined
Set the value of .size according to vector.
.setSize(x: Number, y: Number ): undefined
Set the value of .size according to the x, y coordinates.