diff --git a/js/Sim.js b/js/Sim.js index 4fefccd9..d862357f 100644 --- a/js/Sim.js +++ b/js/Sim.js @@ -894,7 +894,17 @@ define( function( require ) { }, getStateJSON: function() { - return JSON.stringify( this.getState(), SimJSON.replacer ); + return JSON.stringify( this.getState(), SimJSON.replacer, 2 ); + }, + + // Assuming that together.js API features are enabled, return the state for this screen + get togetherState() { + return JSON.stringify( phet.together.getState( this ), SimJSON.replacer, 2 ); + }, + + set togetherState( stateString ) { + var state = JSON.parse( stateString, SimJSON.reviver ); + phet.together.setState( this, state ); }, getScreenshotDataURL: function() {