Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature request] instantly preview a scene #129

Closed
jcyuan opened this issue Jun 24, 2021 · 3 comments
Closed

[feature request] instantly preview a scene #129

jcyuan opened this issue Jun 24, 2021 · 3 comments
Labels
Enhancement New feature or request

Comments

@jcyuan
Copy link

jcyuan commented Jun 24, 2021

Hi, Arian,

Thanks for your efforts always,
Till now i feel the editor should have a preview scene functionality which will make the work more efficent.
Not like the Launch button it will launch the whole project, the preview only launches the scene you wanna check whether it works or not, without this functionality, i need to switch a lot of times between scenes especially when my game logic is complex.

thanks a lot man!

@PhaserEditor2D
Copy link
Owner

Hi! I think we can make this if you include the Phaser Editor DevTools in your game.

The Phaser Editor DevTools is just an idea, for now. But it's exciting and I will add it to the TODO list with medium priority.

@PhaserEditor2D
Copy link
Owner

Thinking again about this. It could be very complicated to do. Just think if you are using webpack or typescript... I think an option is to launch the game like the "play" button but with a query parameter to indicate to the game to switch to the scene at the startup. Something like this:

http://localhost:8080?start=Level

Sure, you should add a bit of code in your Preloader scene so as soon it loads all the game assets then it reads the query parameters and goes to the given scene. Sure, we should make it only available in a development setup.

I should think more about this.

@PhaserEditor2D PhaserEditor2D added the Enhancement New feature or request label Apr 25, 2023
@PhaserEditor2D
Copy link
Owner

I liked this so much that I implemented it! Now, with Ctrl+0 you can run the game and start the current scene. Sure, it requires your game to get the start URL parameter and jump to the given scene. However, I included this logic in the webpack starter template.

The command is also available in the Scene menu:

image

It opens the game like this:

Screenshot 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants