phat-leg-example.js

total 0
used 0
limit 0
/* title: Most Minimal Example categories: minimal files: head point pointlist stage stroke --- The minimal requirements include the _head_, _stage_, and the _point_. */ class MainStage extends Stage { canvas = 'playspace' mounted() { // this.point = new Point(30, 40, 100) this.points = PointList.generate.list(100, point(5,5), [200, 100]) this.tick = 0 /* stage.phase = Math.PI2 == 0 */ /* stage.phase = Math.PI / (stage.points.length * .5 ) */ this.phase = Math.PI /10 this.speed = .01 this.size = 50 this.centerShift = 60 // this.phase = Math.PI /109 // this.speed = .01 } draw(ctx){ this.clear(ctx) this.tick += 1 // this.point.pen.line(ctx, undefined, 'red') this.points.each.radius = (p, i)=> (Math.cos((i * this.phase)+ (this.tick * this.speed) ) * this.size) + this.centerShift this.points.forEach((p)=>{ p.pen.line(ctx, undefined, 'red') }) } } stage = MainStage.go(/*{ loop: true }*/)
Run
Meta Data
title Most Minimal Example
imports ()
files ('head', 'point', 'pointlist', 'stage', 'stroke')
unused_keys ()
unknown_keys ('categories',)
categories ['minimal']
filepath_exists True
path phat-leg-example.js
filepath phat-leg-example.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/stage-resize.js', '../point_src/functions/resolve.js', '../point_src/stage.js', '../point_src/setunset.js', '../point_src/stroke.js')
markdown {'html': '<p>The minimal requirements include the <em>head</em>, <em>stage</em>, and the <em>point</em>.</p>', 'content': 'title: Most Minimal Example\ncategories: minimal\nfiles:\n head\n point\n pointlist\n stage\n stroke\n---\n\nThe minimal requirements include the _head_, _stage_, and the _point_.'}