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

Missing Instance names #195

Closed
MerlinEl opened this issue Mar 16, 2022 · 10 comments
Closed

Missing Instance names #195

MerlinEl opened this issue Mar 16, 2022 · 10 comments

Comments

@MerlinEl
Copy link

Version

  • Phaser Editor 2D Version: 3.32.1 AllInOne
  • Operating System:
  • Web Browser and version: Windows 2011

Description

-add some prefab instances in to scene
-print one random instance properties in to console > console.dir(instance_01);
you will see that instance name is an empty string.

Possible solution

-for now I'm adding a new property "instanceName" which is readable
(but is double work, why not use names if they are already there ;-)

@PhaserEditor2D
Copy link
Owner

I should think more about this. I previous versions of the editor I added the option of using the Label parameter as the name property too. I can do this for this version. Or you can just create Name user component.

The way of adding metadata to an object in Phaser Editor 2D is creating user components (or prefab user properties).

@MerlinEl
Copy link
Author

yes yes , I'm already using an component to achieve this.
2022-03-23_13h25_33

but , the real name should be accessible ;-)
also, the names generator is generating names exponentially
that may cause memory overflows.
2022-03-23_13h20_41

@PhaserEditor2D
Copy link
Owner

also, the names generator is generating names exponentially

This one is another issue. Those are the variable names and I agree it is getting too long.

@PhaserEditor2D
Copy link
Owner

but , the real name should be accessible ;-)

Please, can you tell me a bit more how do you pretend to use the name property?

@PhaserEditor2D
Copy link
Owner

I will add a checkbox for enabling using the Variable Name as the game object's name value.

@PhaserEditor2D
Copy link
Owner

PhaserEditor2D commented Mar 27, 2022

GOName parameter

GOName in code

Ok, look if you enable the new GO Name checkbox, it will generate as name the "bitmaptext" value, which is the same of the variable's name.

PhaserEditor2D added a commit that referenced this issue Mar 27, 2022
@PhaserEditor2D
Copy link
Owner

Done.

Please, can you create a new issue about:

also, the names generator is generating names exponentially
that may cause memory overflows.

@MerlinEl
Copy link
Author

MerlinEl commented Apr 2, 2022 via email

@MerlinEl
Copy link
Author

MerlinEl commented Apr 2, 2022

GOName parameter GOName in code

Ok, look if you enable the new GO Name checkbox, it will generate as name the "bitmaptext" value, which is the same of the variable's name.

This one is good. It will be nice to check this option true as default

@PhaserEditor2D
Copy link
Owner

the name property is good to use in loops where you need to know : 1. name of a button which is pressed (used on switch to perform desired action) 2. name of drag and drop item which is dropped on area (compare list of names which is allowed to drop here) 3. generally iterate with scene objects

Thanks. Yes, I think many users use these kind of techniques so it is fine for me to include the name property. Just a reminder, you can create list of objects in the Scene Editor: https://help.phasereditor2d.com/v3/scene-editor/object-list.html

And sure, you can always add metadata to an object using the User Components.

This one is good. It will be nice to check this option true as default

Well, I think setting this ON by default will generate a lot of code that is not required in most of the cases.

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

No branches or pull requests

2 participants