Skip to content

Commit

Permalink
Bumping scenery dist, and fixing a few items in Tour of Scenery, see #…
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanolson committed Jul 29, 2024
1 parent 4d2f096 commit 7901dcb
Show file tree
Hide file tree
Showing 3 changed files with 367 additions and 134 deletions.
472 changes: 348 additions & 124 deletions dist/scenery.debug.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/scenery.min.js

Large diffs are not rendered by default.

27 changes: 18 additions & 9 deletions doc/a-tour-of-scenery.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ <h3>Hello World</h3>

// Create a display using this root node, using our existing div
const display = new phet.scenery.Display( scene, {
container: document.getElementById( 'hello-world-scene' )
container: document.getElementById( 'hello-world-scene' ),
listenToOnlyElement: true
} );

// Add our text
Expand Down Expand Up @@ -161,7 +162,8 @@ <h3>Shapes</h3>
$( window ).ready( () => {
const scene = new phet.scenery.Node();
const display = new phet.scenery.Display( scene, {
container: document.getElementById( 'shapes-scene' )
container: document.getElementById( 'shapes-scene' ),
listenToOnlyElement: true
} );

// A rectangle at (10,10) with a width of 50 and height of 80
Expand Down Expand Up @@ -291,7 +293,8 @@ <h3>Nodes</h3>
$( window ).ready( () => {
const scene = new phet.scenery.Node();
const display = new phet.scenery.Display( scene, {
container: document.getElementById( 'self-and-children' )
container: document.getElementById( 'self-and-children' ),
listenToOnlyElement: true
} );

// create a node that will have child nodes.
Expand Down Expand Up @@ -397,7 +400,8 @@ <h3>Images</h3>
$( window ).ready( () => {
const scene = new phet.scenery.Node();
const display = new phet.scenery.Display( scene, {
container: document.getElementById( 'image-scene' )
container: document.getElementById( 'image-scene' ),
listenToOnlyElement: true
} );

// TODO: support different ways of handling the asynchronous load https://github.com/phetsims/scenery/issues/1581
Expand Down Expand Up @@ -445,15 +449,17 @@ <h3>DOM Elements</h3>
$( window ).ready( () => {
const scene = new phet.scenery.Node();
const display = new phet.scenery.Display( scene, {
container: document.getElementById( 'dom-simple' )
container: document.getElementById( 'dom-simple' ),
listenToOnlyElement: true
} );

const element = document.createElement( 'span' );
element.innerHTML = '<label style="display: inline;">Type in me:</label><input type="text">';

scene.addChild( new phet.scenery.DOM( element, {
x: 50,
rotation: Math.PI / 4
rotation: Math.PI / 4,
allowInput: true
} ) );

display.updateDisplay();
Expand All @@ -466,7 +472,8 @@ <h3>DOM Elements</h3>

scene.addChild( new phet.scenery.DOM( element, {
x: 50,
rotation: Math.PI / 4
rotation: Math.PI / 4,
allowInput: true
} ) );
</pre>

Expand All @@ -492,7 +499,8 @@ <h3>Animation</h3>
$( window ).ready( () => {
const scene = new phet.scenery.Node();
const display = new phet.scenery.Display( scene, {
container: document.getElementById( 'animation-simple' )
container: document.getElementById( 'animation-simple' ),
listenToOnlyElement: true
} );

// a hexagon to rotate
Expand Down Expand Up @@ -603,7 +611,8 @@ <h4>Colored by quantity of pointers inside shape</h4>
$( window ).ready( () => {
const scene = new phet.scenery.Node();
const display = new phet.scenery.Display( scene, {
container: document.getElementById( 'input-mouseover' )
container: document.getElementById( 'input-mouseover' ),
listenToOnlyElement: true
} );

// hook up event listeners just on this scene (not the whole document)
Expand Down

0 comments on commit 7901dcb

Please sign in to comment.