Coder Social home page Coder Social logo

Comments (5)

tomblind avatar tomblind commented on May 19, 2024 1

The problem with the current data property is that it only works on Phaser.Sprite objects, not Phaser.Group objects. Having a similar capability on groups would be very helpful.

from phasereditor2d-v3.

PhaserEditor2D avatar PhaserEditor2D commented on May 19, 2024

That's a feature that unity developers always ask and definitively we have to think on a solution for it. In Phaser there is the "data" property (Phaser.Sprite.data) that has that function of "custom properties". We already support it in the editor, you can edit the "data" and write its JSON value:

http://phasereditor.boniatillo.com/blog/quick-start/080-canvas#DataEditor

Sure, it is not so powerful as the Unity model and I am going to think about how to improve the editor in that field. To extract custom properties from JavaScript code could be difficult since there is many ways to do it, it is not like in C#, but we should find a way.

from phasereditor2d-v3.

PhaserEditor2D avatar PhaserEditor2D commented on May 19, 2024

the data property is not available in groups in Phaser, however I think in the editor we can add it in near release.

from phasereditor2d-v3.

PhaserEditor2D avatar PhaserEditor2D commented on May 19, 2024

Thinking on this again.

from phasereditor2d-v3.

PhaserEditor2D avatar PhaserEditor2D commented on May 19, 2024

Hi @tomblind,

Done. Now you can define "public" properties in the prefab, and change the property value in the prefab instance.

Key differences with Unity:

  • The properties are declared visually, and code-generated by the scene compiler.

  • The properties do not affect the rendering of the object in the Scene Editor. We don't run user code inside the Scene Editor.

Here is the documentation: https://help.phasereditor2d.com/v3/scene-editor/prefab-user-properties.html

This is a video about it: https://www.youtube.com/watch?v=3ppowkkgz8Q

from phasereditor2d-v3.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.