Jump to content
  • Advertisement
Sign in to follow this  

xna resizing question

This topic is 3415 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
Well, depending on what you mean this could be a way to go about doing it. Have to variables like:

int imageHeight = 800;
int imageWidth = 600;

Then for the keypress:

if(Up Arrow Pressed){
imageHeight--;
}else if(Down Arrow Pressed){
imageHeight++;
}

And so on. Then to draw it you'd do:

spriteBatch.Draw(image, new Rectangle(x,y, imageWidth, imageHeight), Color.White);

I think that is what you mean. If not just let me know. Or if you need the keyboard input in XNA explained.

Share this post


Link to post
Share on other sites
oh forgot to mention the grow / shrink is for the entire image. I was trying to make a image slowly shrink when the up arrow is pressed and slowly grow when the down arrow is pressed to give the illusion of my character walking off in the distance or moving up close to the screen.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!