Legomite Posted February 5, 2017 Share Posted February 5, 2017 I'm trying to put an arcade physics body unto the game, but without a sprite. Is that possible? Link to comment Share on other sites More sharing options...
Ralph Posted February 5, 2017 Share Posted February 5, 2017 Why not just make a sprite with no texture? Link to comment Share on other sites More sharing options...
Legomite Posted February 5, 2017 Author 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? Link to comment Share on other sites More sharing options...
PixelProgrammer Posted February 5, 2017 Share Posted February 5, 2017 @Legomite Theoretically it should cost less since it wouldn't have to render it. Link to comment Share on other sites More sharing options...
scheffgames Posted February 5, 2017 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. Link to comment Share on other sites More sharing options...
Arcanorum Posted February 5, 2017 Share Posted February 5, 2017 Did you even bother to search for this question beforehand? Link to comment Share on other sites More sharing options...
samme Posted February 5, 2017 Share Posted February 5, 2017 A sprite always has a texture. If you omit `key` it gets the default texture, 1 × 1 transparent. Link to comment Share on other sites More sharing options...
Recommended Posts