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

cannot add blank sprite (uses previous sprite texture) #2173

Closed
jmp909 opened this issue Oct 28, 2015 · 2 comments
Closed

cannot add blank sprite (uses previous sprite texture) #2173

jmp909 opened this issue Oct 28, 2015 · 2 comments

Comments

@jmp909
Copy link

jmp909 commented Oct 28, 2015

it does not seem possible to add a blank sprite unless it is the first sprite created
http://phaser.io/sandbox/vXVjSgyw/play

if game.add.sprite (0,0) is the first call, then the sprite will be blank (so you can add Phaser.Graphics to it etc)

however if it is called with no texture supplied, after another sprite has been used with a texture previously, it uses that texture (although not at the same dimensions)

@jmp909
Copy link
Author

jmp909 commented Oct 30, 2015

for anyone reading. you can currently use
mySprite.texture.baseTexture.skipRender = false
and no texture will be shown

zatch added a commit to atomdmac/gut-buster that referenced this issue Oct 30, 2015
A blank image is available for use on sprites that shouldn't be
rendered. This is necessary due to a bug introduced in Phaser 2.4.4
where sprites created without an image would default to the image
used by the previously created sprite.
phaserjs/phaser#2173

Signed-off-by: Zach Bennett <[email protected]>
@photonstorm
Copy link
Collaborator

Closing as this is fixed in the dev branch.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 9, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants