This repository was archived by the owner on Oct 5, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Element
David Peicho edited this page Sep 8, 2017
·
1 revision
You already saw how to apply a style to any Element. You will see in depth what every element in VRUI has access to. If you checked the diagram in the first part of the wiki, you could have seen that everything is an Element. Consequently, every attributes and method that we will described here are accessible in views and layouts.
Below are listed the attributes and methods of all elements. You can modify them as you want. However, it is not advised to modify any field beginning with an underscore (e.g: _myField). You must also use setters if they exist, as they may do some preprocessing.
-
refresh(): refreshes the element, and all its children if it has some. Refresh will recompute the bounds of the hierarchy and scale/position the elements accordingly. -
set(style): sets every style properties listed in thestyleobject. You can have a description of all the properties in this section -
onChange(callback): adds callbackcallbacktriggered when the element change. The callback is triggered depending on the type of object it is on. For instance, on ImageButton,onChangeis triggered when the button is pressed / released, but on SliderView, it is triggered when the slider value is updated. -
onHoverEnter(callback): adds callbackcallbacktriggered when the input enter the element area. -
onHoverExit(callback): adds callbackcallbacktriggered when the input exit the element area.
-
group: THREE.Group object, containing every THREE.Object3D. For instance, the background is a mesh with a material (potentially with a texture), and this mesh is added to the group. If you want to move an element and its children, for instance to animate something, it is the best way! -
parent: reference to the parent element, if any. It is used inside the library, but could be useful in some cases. -
style: contains a copy of the given style. -
hover: true if the input is hover the element, false otherwise. -
userData: if you want to extend VRUI with custom data, use this object! -
_background: mesh containing representing the background.