-
Notifications
You must be signed in to change notification settings - Fork 0
Templates
Shaye Garg edited this page Sep 29, 2021
·
8 revisions
Templates and behavior expressions are what lets you actually do stuff with behave
.
A template is essentially a function that can be use
d inside the behavior
element (or inside other template
s).
The template can then generate behavior expressions according to the arguments it receives.
behave
has many behavior expressions:
use
component
animation
visible
emissive
interaction
events
update
inputevent
A template definition has the form:
template <ident>(<args>) {
<anything_that_can_go_in_behavior>
}
anything_that_can_go_in_behavior
:
- Any behavior expression
- An expression that either evaluates into a behavior expressions or
none
(likeif
s andswitch
es. - Variable declarations.