📰Getting Started | ⭐**Updates |** 📝 Guides | 🔢 API | ❓FAQ
Web Editor Basics
HoloLens
Mobile
Meta Quest
Chapter Series Documentation
Assets
Scripting
Enklu Embedded
API Reference
Release Notes
FAQ
Contact
VineML
is a powerful markup language designed to be very familiar to anyone that has used HTML. It is useful for creating any type of element hierarchy in a scene and assigning values to those elements. A combination of VineML
and Behavior
scripts can be used to create rich applications in Enklu.
<?Vine>
/* A vine header is optional, but helps with code readability.*/
/* Documents can have only a single root element. */
<Float>
/* Tags can be self closing like this button. */
<Button label='Hello World!' />
</Float>
Note that VineML supports C-style block comments.
VineML
files are called documents. These documents are made up of a hierarchy of nested tags
, starting from a single root element. Each tag can have zero or more attributes. To create your first VineML
document, it's easiest to jump right in with an example.
<aside> ⚠️ Warning: All vines must start with < so put any comments below that starting line
</aside>
This is not valid VineML
.
/* This will create an error*/
<?Vine>
This is valid VineML
.
<?Vine>
/* This will work fine*/
This is not valid VineML
.
<Container>
These are both valid options.
<Container></Container>
<Container />
This is not valid VineML
.
<Text>Hello World</Text>
Instead, we use attributes.
<Text label='Hello World' />
Tags follow XHTML conventions, i.e. every tag must be closed. In HTML, we can write <br>
, but in VineML
this is invalid. Every tag must have a closing tag or it must be a self-closing tag.
In addition, tags may not have raw text inside of them. All values are passed to tags through attributes.
<Text
label='Hello'
font.size=100
width=1000.5
position=(0, 1, 1)
/>
While tags define the object structure, attributes define the object properties. VineML
has support for string, boolean, number, and vector literals. Any property of an element may be passed through element attributes.
Vines can be embedded into Behavior
scripts with the use the of the global app
object found throughout every project. Here is an example of creating an array of vines inside a Behavior
script. You can create and control more complex vine systems using this style. Check out the public Button script for another reference.
var self = this;
var text = "hello";
var arrayElements = [];
var numberOfElements = 5;
function enter() {
var position = vec3(0,0,0);
for(let i=0; i<numberOfElements; i++){
position.y +=0.05;
//create array of vines
arrayElements[i] = app.elements.createFromVine(self,
'<Text id="myVineID" label="' + text +
'" fontSize= 50"' +
'"position=' + position +
'"/>'
);
}
}
function exit() {
for(let i=0; i<numberOfElements; i++){
//destroy vines to prevent a memory leak
app.elements.destroy(numberOfElements[i]);
}
}
module.exports = {
enter: enter,
exit: exit
};
VineML supports several built-in elements that you can use to build complex interactions for your experience. All tag elements share a core set of attributes.
name | type | default | description |
---|---|---|---|
id | string |
A generated guid |
An ID that is unique to the experience. |
name | string |
The tag name (i.e, "Button" ) |
A descriptive name. |
visible | bool |
true |
Whether the element is visible in the scene. |
postition | vec3 |
vec3(0,0,0) |
The relative position of the element. |
rotation | vec3 |
vec3(0,0,0) |
The element's rotation. |
scale | vec3 |
vec3(1,1,1) |
The element's scale. |
color | col4 |
col4(1,1,1,1) |
The base color of the element. |
virtualColor | string |
"None" |
A Virtual Color tint applied to the widget. |
alpha | float |
1.0 |
The transparency of the element. |
colorMode | int |
0 (WidgetColorMode.InheritColor) |
How the element's color is affected by the color of its parent. |
tweenIn | int |
1 (TweenType.Responsive) |
The type of tween applied when fading in. |
tweenOut | int |
1 (TweenType.Responsive) |
The type of tween applied when fading out. |
layerMode | int |
0 (LayerMode.Default) |
Determines whether an element is considered to be in the front, middle, or back. |
autoDestroy | bool |
false |
Wheter an element should be detstroyed when it is no longer visible. |
face | string |
null |
Describes whether the element should always face a certain direction |
<Container>
An invisible element used for organization, often as the root tag of a VineML
script.
<Text>
An element for displaying text.
<Text
label='Hello'
fontSize=200
position=(0,0.5,0)
fontColor='#2DCCD3'
/>
name | type | default | description |
---|---|---|---|
label | string |
null |
The text to display. |
font | string |
OpenSans-Regular |
A supported Font |
fontSize | int |
80 |
The size of the text. |
fontColor | string |
White |
The Virtual Color color of the text. |
alignment | string |
"MidRight" |
The alignment of the text. See Text Alignment Values below for all acceptable values. |
display | string |
"Overlay" |
Controls how the text is displayed in the environment. See Text Display Value below for all acceptable values. |
width | float |
1500 |
The maximum width of a line of text. |
height | float |
0 |
The height of the text display. |
lineSpacing | float |
1 |
How much space is between lines of text. |
overflow | string |
Overflow |
Horizontal wrapping behavior. See Horizontal Wrap Values below. |
verticalOverflow | string |
Overflow |
Vertical wrapping behavior. See Vertical Wrap Values below. |
text.shadow.color | col4 |
null |
Text shadow color |
text.shadow.offset | vec3 |
null |
Text shadow offset |
text.outline.color | col4 |
null |
Text outline color |
text.outline.offset | vec3 |
null |
Text outline offset |
<Button>
Basic button element.
A <Button>
element contains a <Text>
, so the attributes of a <Text>
element may also be applied.
name | type | default | description |
---|---|---|---|
src | string | null |
URL for icon. |
icon | string | null |
Name of icon, as given in icon list. |
label | string | null |
The button's label. |
font | string | OpenSans-Regular |
A supported Font |
label.padding | int | 60 |
Determines distance between center of circle and label. |
fontSize | int | 80 |
Determines the font size of the button's label. |
icon.scale | float | 1 |
Icon scale multiplier. |
voiceActivator | string | null |
If set to a keyword, adds voice recognition for activating a button. |
layout | string | "horizontal" |
Describes how the button is laid out. Can be set to horizontal or vertical. If set to anything other than vertical, the layout will be horizontal. |
aim.multiplier | float | 1 |
Scalar for aim, which is used to determine how a button is activated. |
stability.multiplier | float | 1 |
Scalar for stability, which is used to determine how a button is activated. |
fill.duration.multiplier | float | 1 |
Scalar for fill duration, used to extend or shorten how long it takes to activate a button. |
ready.frameScale | float | 1 |
Scale of the button's frame while in the ready state. |
activating.frameScale | float | 1 |
Scale of the button's frame while in the activating state. |
activated.frameScale | float | 1 |
Scale of the button's frame while in the activated state. |
ready.scale | vec3 | (1,1,1) |
Scale of the button in the ready state. |
activating.scale | vec3 | (1.1,1.1,1.1) |
Scale of the button in activating state. |
activated.scale | vec3 | (1,1,1) |
Scale of the button in activated state. |
ready.color | string | "Ready" |
The Virtual Color of the button's ready state. |
ready.captionColor | string | "Primary" |
The Virtual Color of the button label in ready state. |
ready.tween | string | "Responsive" |
The Tween Type of the button in ready state. |
activating.color | string | "Interacting" |
The Virtual Color of the button's activating state. |
activating.captionColor | string | "Interacting" |
The Virtual Color of the button label in activating state. |
activating.tween | string | "Responsive" |
The Tween Type of the button in activating state. |
<Image>
Displays an image.
| --- | --- | --- | --- |
<Menu>
A paginated display for menu options. The menu options are comprised of the tag's children.
| --- | --- | --- | --- |
<SubMenu>