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

A list of bugs & improvements #525

Closed
tobspr opened this issue Apr 13, 2018 · 4 comments
Closed

A list of bugs & improvements #525

tobspr opened this issue Apr 13, 2018 · 4 comments

Comments

@tobspr
Copy link

tobspr commented Apr 13, 2018

I've been using phaser for a more or less bigger project, and there have been a number of issues which I would like to address and which have bugged me:

  • Phaser comes in with a bunch of components which are not required. Why does every Image have to have a LifeSpan component for example? I had to patch out those methods
  • When not using a physics engine, I still have expensive calls to the Physics component. Is this really required? I also patched out that methods.
  • The InWorld component is not really useful due to how slow the bounds computation is. At least for me, this meant I had to come up with my own culling - annoying
  • Text.setText() does not check if the text is already the same (when passing immediate). This causes huge performance problems. I had to pass immediate since otherwise the bounds would get computed too late, and thus the text would "jump" for one frame - I did override the method to check for the same text first
  • Disabling antialiasing does not really work in canvas mode. I had to patch the postUpdate methods of the FixedToCamera component and the Group class. I also had to do game.renderer.context.imageSmoothingEnabled = false (+vendor prefixes), phaser does not seem do that

And one which really annoyed me:

  • game.make.sprite, game.make.image, etc. all create the element without parenting it,
    however, game.make.group will parent it to game.world if not passing null as parent.
    This caused elements to be visible, but not recieving proper events for example. If I don't specify a parent, I would really expect that the element is not parented then. Figuring this out costed me a lot of time.

All in all, I am a bit disappointed from the engine. Having worked with other engines, I had expected much more from such a big engine. I had to heavily modify it to make it fit to my needs.

@photonstorm
Copy link
Collaborator

The final phrase is key. Those were your specific needs. It doesn't mean they apply to everyone.

@tobspr
Copy link
Author

tobspr commented Apr 14, 2018

@photonstorm Sure, I never said this is the way to go. This is just a list of suggestions & bugs I found while using phaser, which I thought might be worth sharing, since some of them are simple improvements without drawbacks.

@photonstorm
Copy link
Collaborator

Which is fair enough, but only one thing listed could actually be considered a bug (the image smoothing one), the rest were tweaks you made for your specific requirements because they were features (that we built-in on purpose) that you didn't need.

A lot of features in v2 were added with the 'common baseline' in mind, yet as soon as developers diverge from that they have to start poking around like you did and overriding internal functions to change behaviors. It's not ideal, but it is what it is. It's also why we rebuilt v3 from scratch to be modular, to avoid most of this. Even then we still have to make some assumptions, they're just a lot less intrusive from the get-go.

@samme
Copy link
Collaborator

samme commented Apr 14, 2018

Text.setText() does not check if the text is already the same (when passing immediate).

You could make a PR for this.

I had to patch the postUpdate methods of the FixedToCamera component and the Group class.

What changes did you make there?

game.renderer.context.imageSmoothingEnabled = false

We could add that in v2.11.0. I don't think I've seen unwanted antialiasing in CANVAS mode myself, though.

game.make.group will parent it to game.world if not passing null as parent.

We could change that v2.11.0, with fair warning.

samme added a commit that referenced this issue Jun 22, 2018
`undefined`, `null`, or `false` all give no parent (#525).

Group() constructor is unchanged, so `parent=undefined` there still adds it to the game world.

Thanks @tobspr
@samme samme closed this as completed May 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants