Skip to main content
Improved formatting
Source Link
doppelgreener
  • 7.3k
  • 7
  • 43
  • 69

Now iI know how to do it  :)

in spritebatch.BeginIn SpriteBatch.Begin() you type:

spriteBatch.Begin(SpriteSortMode.Texture, null,null,null,null,null, Matrix.CreateTranslatio(X,Y,0));

spriteBatch.Begin(SpriteSortMode.Texture,
    null,null,null,null,null,
    Matrix.CreateTranslation(X,Y,0));

Since it is a 2d2D game i'mI'm working on the Z axelaxis is 0.

X and Y are werewhere you want your camera to be, so for my example iI can type: Player_position.X - drawOfSet,Player_position.Y - drawOfSet.

Player_position.X - drawOffSet
Player_position.Y - drawOffSet

But thanks for the help anyway

Now i know how to do it:)

in spritebatch.Begin you type:

spriteBatch.Begin(SpriteSortMode.Texture, null,null,null,null,null, Matrix.CreateTranslatio(X,Y,0));

Since it is a 2d game i'm working on the Z axel is 0.

X and Y are were you want your camera to be, so for my example i can type: Player_position.X - drawOfSet,Player_position.Y - drawOfSet.

But thanks for the help anyway

Now I know how to do it  :)

In SpriteBatch.Begin() you type:

spriteBatch.Begin(SpriteSortMode.Texture,
    null,null,null,null,null,
    Matrix.CreateTranslation(X,Y,0));

Since it is a 2D game I'm working on the Z axis is 0.

X and Y are where you want your camera to be, so for my example I can type:

Player_position.X - drawOffSet
Player_position.Y - drawOffSet

But thanks for the help anyway

Source Link
Eric Nilsson
  • 101
  • 1
  • 2
  • 4

Now i know how to do it:)

in spritebatch.Begin you type:

spriteBatch.Begin(SpriteSortMode.Texture, null,null,null,null,null, Matrix.CreateTranslatio(X,Y,0));

Since it is a 2d game i'm working on the Z axel is 0.

X and Y are were you want your camera to be, so for my example i can type: Player_position.X - drawOfSet,Player_position.Y - drawOfSet.

But thanks for the help anyway