Skip to content

Swapper

Eric edited this page Nov 18, 2022 · 5 revisions

Swapper is an infinite horizontal scroller that uses 3 containers and swaps them around to keep a low number of containers.

OML

 {"#swapper:Swapper": {
      "id": "swapper"
 }}

Set map at runtime

 let swapper = app.cfind('Swapper', 'swapper');
 swapper.map([myFunction, myFunction, myFunction]);

 function(__pt){
      //__pt holds the absolute and relative points
      //compute and return some html based on __pt
      let html = YOUR_HTML;
      reeturn html;
 }

Methods

 swapper.move(px);
Clone this wiki locally