-
Notifications
You must be signed in to change notification settings - Fork 46
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
Option to mark a scene as a preload scene #53
Comments
Please, can you write some code examples? I don't get what's your proposition. |
My proposition is to bring back this feature from Phaser Editor v1. Enabling a scene as a preloader will make it so all the sprites are created in the preload method.
https://help.phasereditor2d.com/v1/canvas.html?highlight=preload#preloader-state-configuration |
You can do that! Look in the Compiler Scene Settings you can change the name of the method to preload the assets and create the objects. So, you can say the editor to generate a class Level extends Phaser.Scene {
_preload() {
// generated by the compiler
this.load.pack(...)
}
_create() {
// generated by the compiler
this.add.image(...)
}
// start user code
preload() {
this._create();
this._preload();
}
// end user code
} |
BTW, I just fixed an issue with the dialog to select the asset pack files to preload. I think I will do a point release with this fix. In the meantime, you can test it following these steps. |
Hi @ItsGravix Is it find the solution I pointed in previous comments? |
@PhaserEditor2D Yes that solution works fine! |
Great, I am closing this. |
It would be great if there was a checkbox to mark a scene as "Preload", which will move the generated sprite code over to the specified preload method instead of the create method. Currently, I have to manually write code to display sprites in my preload scene.
The text was updated successfully, but these errors were encountered: