wacom-pen-example.js

total 0
used 0
limit 0
/* title: Wacom Pen categories: Pen files: head point stage ../point_src/events.js --- The Pen API with pressure and tilt etc. */ class MainStage extends Stage { canvas = 'playspace' mounted() { this.point = this.center.copy() this.presenter = navigator.ink.requestPresenter({ presentationArea: this.canvas }); } draw(ctx){ this.clear(ctx) this.point.pen.indicator(ctx) } async onPointerMove(ev) { ev.preventDefault() ev.stopImmediatePropagation() var tilt = JSON.stringify({ x: ev.tiltX, y: ev.tiltY }); console.log(`${tilt} ${ev.pressure} ${ev.altitudeAngle} ${ev.pointerType} ${ev.twist}`); this.point.update({ radius: 15 * ev.pressure , x: ev.x , y: ev.y }); (await this.presenter).updateInkTrailStartPoint(ev, { diameter: 1, color: 'red' }); } } stage = MainStage.go(/*{ loop: true }*/)
Run
Meta Data
title Wacom Pen
imports ()
files ('head', 'point', 'stage', '../point_src/events.js')
unused_keys ()
unknown_keys ('categories',)
categories ['Pen']
filepath_exists True
path wacom-pen-example.js
filepath wacom-pen-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/stage-hooks.js', '../point_src/stage-resize.js', '../point_src/functions/resolve.js', '../point_src/stage.js', '../point_src/events.js')
markdown {'html': '<p>The Pen API with pressure and tilt etc.</p>', 'content': 'title: Wacom Pen\ncategories: Pen\nfiles:\n head\n point\n stage\n ../point_src/events.js\n---\n\nThe Pen API with pressure and tilt etc.'}