Legomite 6 Posted February 5, 2017 Report Share Posted February 5, 2017 I'm trying to put an arcade physics body unto the game, but without a sprite. Is that possible? Quote Link to post Share on other sites
Ralph 4 Posted February 5, 2017 Report Share Posted February 5, 2017 Why not just make a sprite with no texture? Quote Link to post Share on other sites
Legomite 6 Posted February 5, 2017 Author Report Share Posted February 5, 2017 14 minutes ago, Ralph said: Why not just make a sprite with no texture? I didn't know that's possible. If it lacks a texture, would it cost less performance than one with a texture? Quote Link to post Share on other sites
PixelProgrammer 1 Posted February 5, 2017 Report Share Posted February 5, 2017 @Legomite Theoretically it should cost less since it wouldn't have to render it. Quote Link to post Share on other sites
scheffgames 91 Posted February 5, 2017 Report Share Posted February 5, 2017 var mySprite = game.add.sprite(0,0); mySprite.width = 100; mySprite.height = 100; game.physics.arcade.enable(mySprite); //in the render function use debug to see it game.debug.body(mySprite); From the top of my head, might not be accurate. You could also use a sprite and set alpha to 0 but that might be bad performance wise. Quote Link to post Share on other sites
Arcanorum 44 Posted February 5, 2017 Report Share Posted February 5, 2017 Did you even bother to search for this question beforehand? Quote Link to post Share on other sites
samme 722 Posted February 5, 2017 Report Share Posted February 5, 2017 A sprite always has a texture. If you omit `key` it gets the default texture, 1 × 1 transparent. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.