ui-controls.js

total 0
used 0
limit 0
/* --- title: UI Controls categories: widgets files: ../point_src/math.js ../point_src/core/head.js ../point_src/pointpen.js ../point_src/pointdraw.js ../point_src/point-content.js ../point_src/pointlistpen.js ../point_src/pointlist.js ../point_src/point.js ../point_src/events.js ../point_src/automouse.js ../point_src/stage.js ../point_src/distances.js ../point_src/dragging.js --- An example of creating basic interactive controls. For these examples the page utilises "Petite Vue" for minimal HTML templating The function `addControl` emits an event for the _mini app_ to collect. */ class MainStage extends Stage { canvas='playspace' // live=false live = true mounted(){ this.point = new Point(300, 400, 100) this.dragging.add(this.point) // this.lerper = new Iterator(0, .1, 1) this.tick = 0 addButton('button', { label: 'my button' }) addControl('text', { field: 'input' , value: 'Bananana' , onchange(ev) {} }) addControl('number type', { field: 'input' , value: 20 , type: 'number' , onchange(ev) {} }) addControl('choice', { field: 'select' , options: [ 'eggs' , 'butter' , 'bacon' , 'bread' ] , stage: this , onchange(ev) { let sval = ev.currentTarget.value } }) addControl('slider', { field: 'range' , stage: this , onchange(ev, unit) { /*slider changed. */ let sval = ev.currentTarget.value unit.value = "sval" } }) } draw(ctx){ this.clear(ctx) let pos = this.mouse.position pos.pen.circle(ctx) this.point.pen.indicator(ctx) } } ;stage = MainStage.go();
Run
Meta Data
title UI Controls
imports ()
files ('../point_src/math.js', '../point_src/core/head.js', '../point_src/pointpen.js', '../point_src/pointdraw.js', '../point_src/point-content.js', '../point_src/pointlistpen.js', '../point_src/pointlist.js', '../point_src/point.js', '../point_src/events.js', '../point_src/automouse.js', '../point_src/stage.js', '../point_src/distances.js', '../point_src/dragging.js')
unused_keys ()
unknown_keys ('categories',)
categories ['widgets']
filepath_exists True
path ui-controls.js
filepath ui-controls.js
clean_files ('../point_src/math.js', '../point_src/core/head.js', '../point_src/pointpen.js', '../point_src/pointdraw.js', '../point_src/compass.js', '../point_src/center.js', '../point_src/point-content.js', '../point_src/pointlistpen.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/relative-xy.js', '../point_src/pointcast.js', '../point_src/point.js', '../point_src/events.js', '../point_src/automouse.js', '../point_src/stage-resize.js', '../point_src/functions/resolve.js', '../point_src/stage.js', '../point_src/distances.js', '../point_src/protractor.js', '../point_src/text/beta.js', '../point_src/dragging.js')
markdown {'html': '<hr />\n<p>An example of creating basic interactive controls. For these examples the page\nutilises "Petite Vue" for minimal HTML templating</p>\n<p>The function <code>addControl</code> emits an event for the <em>mini app</em> to collect.</p>', 'content': '---\ntitle: UI Controls\ncategories: widgets\nfiles:\n ../point_src/math.js\n ../point_src/core/head.js\n ../point_src/pointpen.js\n ../point_src/pointdraw.js\n ../point_src/point-content.js\n ../point_src/pointlistpen.js\n ../point_src/pointlist.js\n ../point_src/point.js\n ../point_src/events.js\n ../point_src/automouse.js\n ../point_src/stage.js\n ../point_src/distances.js\n ../point_src/dragging.js\n\n---\n\nAn example of creating basic interactive controls. For these examples the page\nutilises "Petite Vue" for minimal HTML templating\n\nThe function `addControl` emits an event for the _mini app_ to collect.'}