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

  • Home
  • SEARCH
  • 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 8604843
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:40:40+00:00 2026-06-12T02:40:40+00:00

I have a question about XNA which I am new too and could not

  • 0

I have a question about XNA which I am new too and could not find a clear answer for in the documentation after searching google.

Question 1:

If I do this:

Rectangle afterMoveRect = collisionRectangle;
afterMoveRect.Offset((int)moveAmount.X, (int)moveAmount.Y);

Did I now:

A. refference collisionRectangle with another name and afterwards moved collisionRectangle

or

B. Created a duplicate copy of collisionRectangle and only moved the copy.

Second question:

If I do this:

Matrix transform = localTransform;

transform = transform * otherTransform;

Did I create a copy of localTransform and mulitplied the copy or did I reference localTransform and multiplied it through another identifier?

The question for both is the same, did I change the original (perhaps unintentionally)

Question 3:

How do you know if you changed the original or not? How do you know if you reference the original with a new name (like in Java) or create a deep copy of the other object when using the assignment operator?

  • 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-12T02:40:40+00:00Added an answer on June 12, 2026 at 2:40 am

    Depends entirely if Rectangle or Matrix is a struct or a class.

    If it is a struct (a value type), it will be copied, you are working on a different instance. If it is a class (a reference type) it will be referenced, you are working on the same object.

    According to the msdn, both Rectangle and Matrix are structs, so you are working on copies.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have question about parsing a specific json string. I didn't find anything which
hi i have a question about the silverlight/xna template for wp7 programming. i start
I have question about the beta Open Graph stuffs. The documentation I am looking
I have a question about degrading performance in XNA. I am using the GameStateManagement
Hello I have question about android spinner I have spinner which is populated by
Hello I have question about android spinner I have spinner which is populated by
I am new to Cocos2D and I have question about texuture loading. When I
I have question about regexp in TCL. How i can find and change some
I am new to ios programing. I have question about the GCD program. 01
In my XNA game, I have an operation which takes about 10ms on my

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.