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
checkPixel issue for Not Phaser.Sprite type #1684
Comments
I can confirm this doesn't throw an error in Phaser 2.3. Equally it doesn't work, i.e. the pixel click is ignored, but it won't crash. So I'll flag this as a feature request for now. |
Thanks @photonstorm .
|
I think a good approach would be to move the checkPixel out to the game object types and allow polymorphism/specialization. (BitmapText and Text work a bit differently, for instance.) I briefly looked at such an approach and could not find immediate fault with it. |
Agreed, although I don't consider this vital enough for the 2.3 release this week. Something for the roadmap perhaps. |
In order to keep the Github issues clear this feature request has been moved to the Phaser 3 wishlist. |
In src/input/InputHandler.js checkPixel method, using if (this.sprite.texture.baseTexture.source) for checking Sprite type, but for other type like BitmapText, it has no texture property, we should check BitmapText instance's children for every char Sprite.
So In phaser-examples-master/examples/text/bitmapfont drag.js, if we set bmpText.input.pixelPerfectClick = true; then when we drag text we will get exception, because bmpText has no texture property.
Hope checkPixel method can be improved for supporting check Not Sprite type.
The text was updated successfully, but these errors were encountered: