Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7763107
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T14:34:55+00:00 2026-06-01T14:34:55+00:00

I have a problem with rotating. I know that I can rotate a Texture2D

  • 0

I have a problem with rotating. I know that I can rotate a Texture2D object with the draw method.

My goal is to rotate a texture by 180°. For example, if I make a picture of a human with the camera where the head is at the bottom, I want to be able to rotate it so that the head is at the top again.

Here is the code or the rotation:

spriteBatch.Draw(Texture, Position, null, Color.White, MathHelper.Pi, new Vector2(), 1.0f, SpriteEffects.None, 0f);

The rotation works fine, but I have another problem:
enter image description here

If I add the texture to position 0,0 after rotating it, it’s not visible anymore.

How do I rotate or maybe reflect the object, so that the red point will be at the top-left corner again?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T14:34:57+00:00Added an answer on June 1, 2026 at 2:34 pm

    http://msdn.microsoft.com/en-us/library/ff433989.aspx

    public void Draw (
         Texture2D texture,
         Vector2 position,
         Nullable<Rectangle> sourceRectangle,
         Color color,
         float rotation,
         Vector2 origin,
         Vector2 scale,
         SpriteEffects effects,
         float layerDepth)
    
    //Using:
    var origin = new Vector2()
    {
        X = texture.Width / 2,
        Y = texture.Height/ 2
    };
    
    
    spriteBatch.Draw(texture, Vector2.Zero, null, Color.White, MathHelper.Pi, origin, 1f, SpriteEffects.None, 0f)`
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem with a UIView-subclass object that I am rotating using Core
I have a section of map I can rotate, after rotating the coordinates I
I have problem with fancybox. I want to write a function that will run
I have problem with cakephp's Session->write method. If I set a value like $_SESSION['..']
i have problem with libhid . i found that there 2 way 4 accessing
i have a problem with rotating a rectangle and place it on a canvas
I am trying to rotate a png that is loaded in Java. The problem
I'm having a problem getting a bitmap to rotate properly. I have a SurfaceView
I have an ImageView that you can use to do a one-finger pan, or
I have an ImageManipulator class that performs some cropping, resizing and rotating of camera

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.