jevisan Posted February 22, 2017 Share Posted February 22, 2017 I'm trying to develop a HUD for my game but im having an unexpected behavior when setting one of my sprites like this: this.mysprite.fixedToCamera = true; the sprite desapears completely, but commenting the line makes the sprite visible just fine. I havent come up with the reason just yet. any ideas? Link to comment Share on other sites More sharing options...
ldd Posted February 22, 2017 Share Posted February 22, 2017 this.mysprite.fixedToCamera = true; this.mysprite.cameraOffset.setTo(0, 0); Link to comment Share on other sites More sharing options...
jevisan Posted February 22, 2017 Author Share Posted February 22, 2017 thanks, that at least put the sprite in the top right corner of my screen, but its really just confusing as why is behaving like that and why is necessary to set the camera offset. the fixedtocamera value must be enough, right? Link to comment Share on other sites More sharing options...
samme Posted February 22, 2017 Share Posted February 22, 2017 Use game.debug.spriteCoords(sprite) to find the sprite. cameraOffset is the (fixed) position of the sprite on the camera view. It's copied from sprite.position when you set fixedToCamera. Link to comment Share on other sites More sharing options...
jevisan Posted February 22, 2017 Author Share Posted February 22, 2017 thanks for your responses, i already figured i have to tweak the cameraOffset values to make the sprite appear where i want it Link to comment Share on other sites More sharing options...
Recommended Posts