Studio Wikiv0.8.7

Wiki / Gameplay Workshop

Connect two scenes with Canvas buttons

Create a workshop scene, send a named button event, and use Visual Actions to travel back and forth.

Create the second scene

Start a new Studio project and keep its first scene as the start screen. Choose File → New Scene…, enter Workshop, and confirm. Studio saves the scene in the current Assets folder as assets/Workshop.scene.json and opens it. Add a Canvas button to the Workshop scene and set its text to Back.

The first scene created by Studio is assets/Main.scene.json; the second scene ID is assets/Workshop.scene.json. Scene IDs are project-relative paths. A button can switch scenes only when its destination is present in the project build.

Send a named event from each button

Open the Workshop button's Inspector and set Events → On Click to return_main. Save the scene, then double-click the Main scene entry in Assets (or choose Open Scene from its menu). Add a Canvas button there, label it Enter workshop, and set its On Click event to enter_workshop.

In Main, select the starter cube and choose Add Component… → Visual Actions. In the action editor, select Named → Named Event. Add If event name matches from Questions, set its event name to enter_workshop, then add Go to scene from Game and set Scene ID to assets/Workshop.scene.json. Apply the program. Repeat in Workshop with Named → Named Event, event return_main, and destination assets/Main.scene.json. The event guard ensures each button only runs its matching transition.

Build and follow the route

After applying the Workshop transition, reopen Main from Assets before the test. Click Test MIDlet; Studio builds and starts the currently open scene. Focus Enter workshop with the direction keys and press Numpad 5. The MIDlet loads Workshop; focus Back and press 5 to return to Main. If a transition does not happen, check the button's On Click spelling and the Visual Action's Scene ID against the path shown in Assets.

The CLI can list scene IDs and check the whole project before you build. Set $project to the folder Studio opened; get $cli, $jdk, and $toolkit from the installed CLI setup guide. scenes shows the project IDs; validate checks all scenes and references; build packages the startup scene and its scene bundle.

powershell
node $cli scenes $project
node $cli validate $project
node $cli build $project --jdk $jdk --toolkit $toolkit