stamping.js

total 0
used 0
limit 0
/* files: head ../point_src/math.js ../point_src/extras.js ../point_src/point-content.js dragging pointlist point stage mouse stroke ../point_src/emitter.js ../point_src/relative.js ../point_src/random.js --- */ class MainStage extends Stage { canvas = 'playspace' mounted(){ this.point = new Point(100, 100, 20) // this.events.wake() let e2 = new RandomPointEmitter(400,400, 60) // e2.direction = {x:-1, y:0} //inward. e2.fromEdge = true e2.tickModulo = 1 e2.speed = .1 e2.birthrate = 20 e2.wake() this.e2 = e2 let e3 = new PumpRandomPointEmitter(500,200, 60) e3.wake() this.e3 = e3 this.dragging.add(e2, e3) // this.dragging.add(this.e1, e2, e3) this.stamp = new Stamp() } firstDraw(ctx){ ctx.fillStyle = '#EEE' ctx.font = `400 16px sans-serif`; ctx.textAlign = 'center' ctx.textBaseline = 'middle' ctx.strokeStyle = '#EEE' } draw(ctx){ this.clear(ctx) // this.drawEmitters(ctx) this.rawDrawEmitters(ctx) } rawDrawEmitters(ctx){ // e.pen.indicator(ctx) // e.points.pen.indicators(ctx) let e = this.e2; e.step() const pi2 = Math.PI2 e.points.forEach(p=>{ ctx.beginPath() const opts = p._opts ctx.arc(opts.x, opts.y, 5, 0, pi2) ctx.stroke() }) // ctx.arc() } drawEmitters(ctx) { let e = this.e2; e.step() e.points.pen.stroke(ctx) } } class Stamp { render(ctx, points, func) { ctx.save(); let prev = points[0] points.forEach((p)=>{ // ctx.translate(p.x, p.y) let np = p.subtract(prev) ctx.translate(np.x, np.y) // ctx.rotate(p.radians) func(np) prev = p }); ctx.restore(); } } stage = MainStage.go(/*{ loop: true }*/)
Run
Meta Data
imports ()
files ('head', '../point_src/math.js', '../point_src/extras.js', '../point_src/point-content.js', 'dragging', 'pointlist', 'point', 'stage', 'mouse', 'stroke', '../point_src/emitter.js', '../point_src/relative.js', '../point_src/random.js')
unused_keys ('title',)
unknown_keys ()
filepath_exists True
path stamping.js
filepath stamping.js
clean_files ('../point_src/core/head.js', '../point_src/math.js', '../point_src/extras.js', '../point_src/compass.js', '../point_src/center.js', '../point_src/point-content.js', '../point_src/functions/clamp.js', '../point_src/distances.js', '../point_src/protractor.js', '../point_src/text/beta.js', '../point_src/dragging.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/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/emitter.js', '../point_src/relative.js', '../point_src/random.js')
markdown {'html': '<hr />', 'content': 'files:\n head\n ../point_src/math.js\n ../point_src/extras.js\n ../point_src/point-content.js\n dragging\n pointlist\n point\n stage\n mouse\n stroke\n ../point_src/emitter.js\n ../point_src/relative.js\n ../point_src/random.js\n\n---'}