lerp-pointlist-through-2.js

total 0
used 0
limit 0
/* title: PointList Lerper method categories: lerp files: head pointlist point stage mouse stroke ../point_src/random.js ../point_src/easing.js ../point_src/iter/lerp.js ../theatre/apple-motion-algo.js --- In this example, we use the `PointList.lerper.through(a, b)`, but edit one of the elements. Importantly the settings for the lerper must be static, else updates to the _current time_ of a unique node is forgotten. */ class MainStage extends Stage { canvas='playspace' mounted(){ let count = 50 this.a = PointList.generate.random(count, [200,350, 20, 200], [60, 150, 1, 1]) this.b = PointList.generate.radius({count: count, offset: {radius:3}}, 140, new Point(500, 300)) this.c = PointList.generate.random(count) addButton('button', { label: 'reset' , onclick() { console.log('click') stage.c.lerper.currentTime = 0 } }) this.persistentLerperSettings = { seconds: 3 , easing: quadEaseOut , 10: { // easing: exponentialEaseInOut // easing: { x: exponentialEaseInOut, y: bounceEaseOut } // easingX: exponentialEaseInOut easing: (t)=>stepMotion(t, .1, 0.8, 4, 3) // , seconds: .7 , delay: 2.6 // , currentTime: -(2.6/.7) } } } resetTime() { /*Relay the time to 0*/ this.currentTime = 0 } draw(ctx) { this.clear(ctx) this.a.pen.indicator(ctx, 'green') this.b.pen.indicator(ctx, {color:'#333'}) this.c.lerper.through(this.a, this.b, this.persistentLerperSettings) this.c.pen.indicator(ctx, {color:'purple'}) this.c[10].pen.fill(ctx, {color:'purple'}) } } ;stage = MainStage.go();
Run
Meta Data
title PointList Lerper method
imports ()
files ('head', 'pointlist', 'point', 'stage', 'mouse', 'stroke', '../point_src/random.js', '../point_src/easing.js', '../point_src/iter/lerp.js', '../theatre/apple-motion-algo.js')
unused_keys ()
unknown_keys ('categories',)
categories ['lerp']
filepath_exists True
path lerp-pointlist-through-2.js
filepath lerp-pointlist-through-2.js
clean_files ('../point_src/core/head.js', '../point_src/pointlistdraw.js', '../point_src/pointlistgradient.js', '../point_src/pointlistshape.js', '../point_src/pointlistgenerator.js', '../point_src/unpack.js', '../point_src/pointlist.js', '../point_src/pointlistpen.js', '../point_src/pointpen.js', '../point_src/compass.js', '../point_src/center.js', '../point_src/point-content.js', '../point_src/pointdraw.js', '../point_src/relative-xy.js', '../point_src/pointcast.js', '../point_src/point.js', '../point_src/stage-resize.js', '../point_src/functions/resolve.js', '../point_src/stage.js', '../point_src/events.js', '../point_src/automouse.js', '../point_src/setunset.js', '../point_src/stroke.js', '../point_src/random.js', '../point_src/easing.js', '../point_src/iter/lerp.js', '../theatre/apple-motion-algo.js')
markdown {'html': '<p>In this example, we use the <code>PointList.lerper.through(a, b)</code>, but edit one of\nthe elements.</p>\n<p>Importantly the settings for the lerper must be static, else updates to the\n<em>current time</em> of a unique node is forgotten.</p>', 'content': 'title: PointList Lerper method\ncategories: lerp\nfiles:\n head\n pointlist\n point\n stage\n mouse\n stroke\n ../point_src/random.js\n ../point_src/easing.js\n ../point_src/iter/lerp.js\n ../theatre/apple-motion-algo.js\n---\n\nIn this example, we use the `PointList.lerper.through(a, b)`, but edit one of\nthe elements.\n\nImportantly the settings for the lerper must be static, else updates to the\n_current time_ of a unique node is forgotten.'}