Skip to content
MANAWAVE DOCS
GitHub

Overriding Default Behavior

If you would like to create highly customized motion in MANAWAVE, you can override the defaults. Overrides are here to give you control to pretty much all of MANAWAVE (or as much as what’s sensible). A good example of this is the realm, Senbonzakura.

This guide is more of a general introduction or starter to using overrides. If you want deeper understanding, you should read the overrides reference page.

Overriding Overall Marquee

onLayout

Invoked each time the marquee has to lay its entire grid of repeated content out again. This usually happens when the marquee is initialized, and when the viewport is substantially resized.

onMove

Invoked each time all the marquee content move.

onLoop

Invoked each time marquee content moves from one end of the marquee to the other.

Overriding Content Lifecycle

These methods give you direct access to each rendered DOM element of all marquee content.

onElementCreated

Invoked when an element is created. This happens when a layout occurs (marquee initialized or website resized).

onElementDraw

Invoked when an element is rendered or updated. This happens when the element moves.

onElementDestroyed

Invoked when an element is destroyed. This happens when a layout occurs (marquee initialized or website resized). You’ll notice this is exactly what happens in onElementCreated. Basically, when a layout occurs, all the old elements are destroyed and replaced by completely new ones.