anchor-line.js

total 0
used 0
limit 0
/* title: Example categories: basic dragging files: head point pointlist stage mouse dragging stroke ../point_src/constrain-distance.js --- */ class MainStage extends Stage { // canvas = document.getElementById('playspace'); canvas = 'playspace' mounted(){ this.speed = 1 this.tick = 0 this.size = 100 this.points = new PointList( [250 , 150] , [250 , 170] , [250 , 190] ).cast() this.dragging.add(...this.points) } draw(ctx){ this.clear(ctx) this.tick += 1 let ps = this.points let size = this.size + (ps[1].radius *2) // ps[1].lookAt(ps[0], 2) ps[1].leash(ps[0], size) ps[2].xy = ps[1].project(ps[0].distanceTo(ps[1]) - size) ps[0].pen.fill(ctx, 'red') ps[1].pen.indicator(ctx, 'green') ps[2].pen.fill(ctx, 'green') ps.pen.quadCurve(ctx) } } stage = MainStage.go(/*{ loop: true }*/)
Run
Meta Data
title Example
imports ()
files ('head', 'point', 'pointlist', 'stage', 'mouse', 'dragging', 'stroke', '../point_src/constrain-distance.js')
unused_keys ()
unknown_keys ('categories',)
categories ['basic', 'dragging']
filepath_exists True
path anchor-line.js
filepath anchor-line.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/events.js', '../point_src/automouse.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/setunset.js', '../point_src/stroke.js', '../point_src/constrain-distance.js')
markdown {'html': '', 'content': 'title: Example\ncategories: basic\n dragging\nfiles:\n head\n point\n pointlist\n stage\n mouse\n dragging\n stroke\n ../point_src/constrain-distance.js\n---'}