c0llage

dumpling

overview

you can create dumplings just like a normal html component The way to do so is by creating an element named <a-dumpling>

a complete dumpling looks something like this

<a-dumpling
  id="example"
  x=10 y=20
  w=30 h=40
  temperament="sanguine"
  bodyClass="coolclass"
  hidden
  noClose
>
  <!-- some content here-->
  <!-- if content is iframe or d-iframe, the frame will have maximize and back buttons-->
</a-dumpling>

attributes

position

unless specified, positions are randomized within the forest frame (with a small margin), so they go from like 5% to 95%.

if you want to control randomization, you can add min- and max- to any attribute to limit/change randomization parameters. There’s also min-size and max-size to specify both max-width and max-height at the same time.

parenting

some dumplings can act as parents to other dumplings. a parent dumpling can hold children, and when you drag the parent around the children will follow it.

examples

<!-- parents --->
<a-dumpling id="pack" holds="*"> <!-- holds coin & ball -->
<a-dumpling id="purse" holds="coin"> <!-- holds coin -->

<!-- children --->
<a-dumpling id="fetching-rock" kind="ball"> <!-- held by pack -->
<a-dumpling id="cursed-disc" kind="coin"> <!-- held by pack & purse -->

other stuff

methods

there are some methods you can call on frames in your js code. Ideally all methods described below can be called in one of 2 ways:

element.methodName() // this assumes you have some reference to the element, like with getElementById or something else
//or
Frames.methodName(elementId)

the current methods are:

events

draggable frames also have events when certain things happen to them. you can add listeners to frames by using the listen method

element.listen(eventName, callback)
// or
Frames.listen(elementId, eventName, callback)

The current implemented events are: