Is it possible to use the 2D camera, but just for a part of the screen? Perhaps I want some info on the screen about score and other things, but I want that at a fixed place, just like when not using a 2D camera?
Tell me more
×
Game Development Stack Exchange is a question and answer site for
professional and independent game developers. It's 100% free, no registration required.
|
Sure! Since there's no concept of 2D camera built into XNA, I am guessing that you are using some class to generate a If that's the case, the solution is simple... All you have to do is draw your score and anything that you don't want to be affected by the camera in a separate
|
|||
|
|
|
Create a Vector2 called Camera. Say you want to show an object with respect to the camera, i.e. a non-HUD object, draw it at a position given by: DrawPosition = ObjectPosition - CameraPosition; For the score and other HUD stuff, don't consider the camera vector. DrawPosition = ObjectPosition; |
|||
|
|