PhaserEditor2D / PhaserEditor2D-v3

A web-based IDE for HTML5 game development. Powered by Phaser.
https://phasereditor2d.com
MIT License
426 stars 57 forks source link

Set custom property to Phaser game object #304

Closed JernejHabjan closed 9 months ago

JernejHabjan commented 9 months ago

image

This image gameobject also has z coordinate, that I'd like to set in the editor, but it's not exposed in the inspector panel. Allow setting any custom property like for prefabs also to game objects like image, sprite

PhaserEditor2D commented 9 months ago

Hi, you can create a user component with additional user properties and add it to any game object in the scene.

https://help-v3.phasereditor2d.com/scene-editor/user-components.html#

JernejHabjan commented 9 months ago

@PhaserEditor2D creating custom component is not what i want, because I want to specify numeric value (0-255) for z axis, which differs from sprite to sprite. As all gameObjects have this property already, id just want to see it in Phaser editor.

PhaserEditor2D commented 9 months ago

Hi @JernejHabjan

So you don't need a custom/user property, what you need is to add the Z property to the editor. It means, a new feature in the editor.

JernejHabjan commented 9 months ago

@PhaserEditor2D that's right. But I presume that most users won't need to see Z property in the panel. Could we have a button to "add" a property and it's value?

PhaserEditor2D commented 9 months ago

Could we have a button to "add" a property and it's value?

Mmm... I don't know I have to think more about it. We have a button to add a user component :)

Btw, why do you need the Z property? What kind of stuff you are making? Maybe it is part of a bigger feature that I plan to implement.

JernejHabjan commented 9 months ago

I'd like to use Z axis to specify at which height the block / sprite is placed in isometric world, as I'd like to create multi-height isometric world.

image

currently I'm writing this Z in custom prefab exposed property, but ideally I'd like to set it to Gameobject.Image as it's just terrain

PhaserEditor2D commented 9 months ago

Oh yes, I have to do more about isometrics. Like a sorting layer. It will help in the case of isometrics and also other kind of worlds.