easing-merge.js

total 0
used 0
limit 0
/* categories: easing files: head point pointlist ../point_src/math.js ../point_src/point-content.js stage mouse ../point_src/stage-clock.js ../point_src/easing.js ../point_src/timeit.js ../point_src/iter/lerp.js ../point_src/random.js */ addButton('move', { // label: 'move' onclick: ()=> console.log('move') }) addControl('easing', { field: 'select' , onchange(ev) { let v = ev.currentTarget.value console.log('set easeNameY to', v) stage.easeNameY = v stage.easeNameX = v stage.easingFunctionX = easingFunctions.get(stage.easeNameX, stage.easyDirX) stage.easingFunctionY = easingFunctions.get(stage.easeNameY, stage.easyDirY) } , options: [ "linear" , "quad" , "cubic" , "quartic" , "sine" , "circular" , "exponential" , "elastic" , "back" , "bounce" ] }) class MainStage extends Stage { // canvas = document.getElementById('playspace'); canvas = 'playspace' mounted(){ this.point = new Point(100, 100, 20) this.microValue = this.clock.frameStepValue(2) // seconds /* quad, cubic, quartic, quintic, sine, circular, exponential, elastic, back, bounce in, out, inOut */ this.easingFunctionX = multiEase( // easingFunctions.sine.inOut, easingFunctions.back.in, easingFunctions.sine.in, // easingFunctions.elastic.in // easingFunctions.bounce.out ) this.easingFunctionY = multiEase( // easingFunctions.back.in, // easingFunctions.sine.out, // easingFunctions.sine.in, // easingFunctions.back.inOut, easingFunctions.bounce.out ) let _this = this; } onClick(ev) { this.dest = Point.from(ev) this.vx = new Value(this.point.x, this.dest.x, this.easingFunctionX) this.vy = new Value(this.point.y, this.dest.y, this.easingFunctionY) this.microStep = 0 } draw(ctx){ if(this.vy) { this.point.x = this.vx.get(this.microStep) this.point.y = this.vy.get(this.microStep) } this.microStep += this.microValue if(this.microStep > 1) { this.microStep = 1 } this.clear(ctx) this.point.pen.fill(ctx, '#880000') } } stage = MainStage.go(/*{ loop: true }*/)
Run
Meta Data
imports ()
files ('head', 'point', 'pointlist', '../point_src/math.js', '../point_src/point-content.js', 'stage', 'mouse', '../point_src/stage-clock.js', '../point_src/easing.js', '../point_src/timeit.js', '../point_src/iter/lerp.js', '../point_src/random.js')
unused_keys ('title',)
unknown_keys ('categories',)
categories ['easing']
filepath_exists True
path easing-merge.js
filepath easing-merge.js
clean_files ('../point_src/core/head.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/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/math.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/stage-clock.js', '../point_src/easing.js', '../point_src/timeit.js', '../point_src/iter/lerp.js', '../point_src/random.js')
markdown {'html': '', 'content': 'categories: easing\nfiles:\n head\n point\n pointlist\n ../point_src/math.js\n ../point_src/point-content.js\n stage\n mouse\n ../point_src/stage-clock.js\n ../point_src/easing.js\n ../point_src/timeit.js\n ../point_src/iter/lerp.js\n ../point_src/random.js'}