PhaserEditor icon indicating copy to clipboard operation
PhaserEditor copied to clipboard

Scene editor: generates invalid variable's name.

Open Marchiuzzz opened this issue 3 years ago • 3 comments

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 avatar Feb 17 '21 08:02 Marchiuzzz

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

Marchiuzzz avatar Feb 17 '21 09:02 Marchiuzzz

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 avatar Feb 17 '21 13:02 PhaserEditor2D

@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)!

michaelgundlach avatar Jan 02 '22 20:01 michaelgundlach