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

Scene editor: generates invalid variable's name. #153

Open
Marchiuzzz opened this issue Feb 17, 2021 · 3 comments
Open

Scene editor: generates invalid variable's name. #153

Marchiuzzz opened this issue Feb 17, 2021 · 3 comments

Comments

@Marchiuzzz
Copy link

Version

  • Phaser Editor Version:3.10.2
  • Operating system:Windows 10

Description

I've added a large image to the scene, when I launch the game it works fine
image

But once I set the scale of this image to 0.3 (both, X and Y) and then launch the game again I get a grey screen and nothing happens.
image

I'm new to this tool and Phaser overall so getting stuck at the first step (a simple image addition) is very frustrating. How can I see if there are any compilation errors in the editor? I've opened up a developer console inside Phaser editor and this is what I get each time I save my scene:
image

Thanks

Possible solution

Perhaps it doesn't run properly because it's running in the built-in game player, how could I run this project in browser?

@Marchiuzzz
Copy link
Author

Found the problem...it's quite funny actually. The name of the image is 1218 and so in generated code I get
image
Since 1218 is an integer it's trying to declare that integer as object

@PhaserEditor2D
Copy link
Owner

Hi @Marchiuzzz

Those errors shown on the console are fixed for the next version of the editor.

I'm glad you found the problem with the image. I will re-open this issue and rename it to "Scene Editor compiler: generate invalid JS idenfifiers".

@PhaserEditor2D PhaserEditor2D changed the title Getting grey screen when launching a game Scene editor compiler generates invalid JS identifiers. Feb 17, 2021
@PhaserEditor2D PhaserEditor2D changed the title Scene editor compiler generates invalid JS identifiers. Scene editor: generates invalid variable's name. Feb 17, 2021
@michaelgundlach
Copy link

@PhaserEditor2D I was bitten by this when I added my first test image as well (from my Photos dir, the first place I could think of to find an image to import as a test, so it was a numeric name)!

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

3 participants