Comments (7)
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 _preload
method and a _create
method, then, you can write your scene like this:
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
}
from phasereditor2d-v3.
Please, can you write some code examples? I don't get what's your proposition.
from phasereditor2d-v3.
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.
preload() {
this.add.sprite(0, 0, "phaser", "loading_dino");
}
https://help.phasereditor2d.com/v1/canvas.html?highlight=preload#preloader-state-configuration
from phasereditor2d-v3.
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.
from phasereditor2d-v3.
Hi @ItsGravix
Is it find the solution I pointed in previous comments?
from phasereditor2d-v3.
@PhaserEditor2D Yes that solution works fine!
from phasereditor2d-v3.
Great, I am closing this.
from phasereditor2d-v3.
Related Issues (20)
- Isometric depth sorting in editor
- v3.65.0 uploaded with a wrong release date in the title HOT 1
- Only Generate Methods no instance to Scene
- Collapsible tags in object tree
- Extending container not supported in editor HOT 6
- Set custom property to Phaser game object HOT 7
- Issue adding new prefab after deleting existing one (Windows) HOT 3
- Move assets from one asset pack to another HOT 1
- Add "protected" scope property option in object settings HOT 1
- Add support to compressed textures
- Preload Pack Files in Compiler Scene Settings doesn't work with webpack
- Deep collapse / expand with Alt modifier
- Ctrl + D to clone game object / script node as a sibling
- Add editor only gizmos
- Outline expanded state is lost on various actions HOT 3
- Pasting multiple script nodes changes their ordering HOT 2
- Display current pointer coordinates
- Cannot change property values of component HOT 6
- Copying & pasting a container should automatically rename the children objects
- Project template for making a discord game activity.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phasereditor2d-v3.