Go Back   Zune Boards > Zune Discussions > Zune Games > Development Discussions > Development Help

Development Help For help from coding to error finding to that one thing you just can't get right

Reply
 
LinkBack Thread Tools
Old 09-12-2009, 05:56 PM   #1 (permalink)
Jr. Member
 
xCyberFang's Avatar
 
Join Date: Apr 2008
Posts: 449
xCyberFang will become famous soon enough
Send a message via AIM to xCyberFang Send a message via MSN to xCyberFang Send a message via Yahoo to xCyberFang
Default How would you go about resizing a games screen?

I have a game for windows that has a big screen size and whatnot, and i want to be able to resize it down to 240x320. i would go through and edit the values to make them align, but theres ALOT of values to edit.

is there any way i could possibly have the game drawed then the screen itself resized? like similar to how the screen can be rotated to horizontal view??
__________________






xCyberFang is offline   Reply With Quote

Advertisement [Remove Advertisement]
Old 09-12-2009, 06:04 PM   #2 (permalink)
Experienced Member
 
ShotgunSnipist's Avatar
 
Join Date: May 2008
Location: Colorado
Posts: 803
ShotgunSnipist has a spectacular aura aboutShotgunSnipist has a spectacular aura about
Send a message via AIM to ShotgunSnipist
Default

I think this is what you are talking about:

public Game1()
{
graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
graphics.PreferredBackBufferHeight = 320;
graphics.PreferredBackBufferWidth = 240;
}
__________________
Invisible Text. =P



ShotgunSnipist is offline   Reply With Quote
Old 09-12-2009, 06:12 PM   #3 (permalink)
Jr. Member
 
xCyberFang's Avatar
 
Join Date: Apr 2008
Posts: 449
xCyberFang will become famous soon enough
Send a message via AIM to xCyberFang Send a message via MSN to xCyberFang Send a message via Yahoo to xCyberFang
Default

Nah, that resizes the screen itself. but it doesnt scale the games drawings any.
__________________






xCyberFang is offline   Reply With Quote
Old 09-12-2009, 06:44 PM   #4 (permalink)
lost in paradise with rae
Support Team
Moderator
Expert Zuner
 
Red Sky's Avatar
 
Join Date: Nov 2007
Location: Pennsylvania
Posts: 2,661
Red Sky is just really niceRed Sky is just really niceRed Sky is just really nice
Send a message via MSN to Red Sky
Default

You would need to have a scale factor. You can figure out that factor mathematically by determining the ratio of large size: 240x320. In the draw method, you can specify a scale.





Red Sky is offline   Reply With Quote
Old 09-12-2009, 08:21 PM   #5 (permalink)
Jr. Member
 
xCyberFang's Avatar
 
Join Date: Apr 2008
Posts: 449
xCyberFang will become famous soon enough
Send a message via AIM to xCyberFang Send a message via MSN to xCyberFang Send a message via Yahoo to xCyberFang
Default

yeah, i can easily get the scaled size of the current window, but im just wondering what is the code i would use??

The current size is 480x640, which itself is 240x320 in scale..

How would i go about doing the scaling itself??
__________________






xCyberFang is offline   Reply With Quote
Old 09-12-2009, 08:28 PM   #6 (permalink)
lost in paradise with rae
Support Team
Moderator
Expert Zuner
 
Red Sky's Avatar
 
Join Date: Nov 2007
Location: Pennsylvania
Posts: 2,661
Red Sky is just really niceRed Sky is just really niceRed Sky is just really nice
Send a message via MSN to Red Sky
Default

Your scale factor would be .5, so you would just use the .5 in your draw method.

Check out the different draw methods, I can't remember off the top of my head.





Red Sky is offline   Reply With Quote
Old 09-12-2009, 08:51 PM   #7 (permalink)
Jr. Member
 
xCyberFang's Avatar
 
Join Date: Apr 2008
Posts: 449
xCyberFang will become famous soon enough
Send a message via AIM to xCyberFang Send a message via MSN to xCyberFang Send a message via Yahoo to xCyberFang
Default

ya. .5, i know. but how would i go about doing this? or where can i find a code.

i know i just dont throw in .5 in the draw lol.
__________________






xCyberFang is offline   Reply With Quote
Old 09-12-2009, 09:49 PM   #8 (permalink)
lost in paradise with rae
Support Team
Moderator
Expert Zuner
 
Red Sky's Avatar
 
Join Date: Nov 2007
Location: Pennsylvania
Posts: 2,661
Red Sky is just really niceRed Sky is just really niceRed Sky is just really nice
Send a message via MSN to Red Sky
Default

It's really not that hard... it's part of the draw method. There's a argument for scale. You put that scale in and BAM it just works.





Red Sky is offline   Reply With Quote
Old 09-12-2009, 09:49 PM   #9 (permalink)
Experienced Member
 
Tiptup300's Avatar
 
Join Date: Apr 2008
Posts: 808
Tiptup300 has disabled reputation
Default

If your planning on drawing the entire game to 800x600 then downsizing it to 240x320 then you're gonna get a big performance hit and the zune doesn't scale pictures smoothly so it will also look like poop.



Tiptup300 is online now   Reply With Quote
Old 09-13-2009, 04:27 PM   #10 (permalink)
Jr. Member
 
xCyberFang's Avatar
 
Join Date: Apr 2008
Posts: 449
xCyberFang will become famous soon enough
Send a message via AIM to xCyberFang Send a message via MSN to xCyberFang Send a message via Yahoo to xCyberFang
Default

Quote:
Originally Posted by Tiptup300 View Post
If your planning on drawing the entire game to 800x600 then downsizing it to 240x320 then you're gonna get a big performance hit and the zune doesn't scale pictures smoothly so it will also look like poop.
Yeah, you got the idea, how exactly would i go about this? like can you give an example that i could work off of (it doesn't need to work or build or whatever, i just want one i can see how i can go about doing this).


The truth behind this is i found a working open source xna pacman copy and i was wanting to attempt to scale it down, i tried resizing it, but there are alot of variables to resize and rather kind of hard, so im wanting to try to scale the screen itself, rather than the components.

I had to remove the sound files which were in xact, and the button input is kind of complex but i think i am getting somewhere, other than those things, i just need help getting it down to 320x240

Dr_Asik: XNA Pac Man
Theres the link if you guys would like to see it, and maybe even challenge yourself to attempt to port it to zunes.
__________________






xCyberFang is offline   Reply With Quote
Old 09-13-2009, 06:11 PM   #11 (permalink)
Experienced Member
 
Tiptup300's Avatar
 
Join Date: Apr 2008
Posts: 808
Tiptup300 has disabled reputation
Default

Code:
batch.Begin(SpriteBlendMode.AlphaBlend, SpriteSortMode.Deferred, SaveStateMode.None, Matrix.Identity * Matrix.CreateScale(scale));



Tiptup300 is online now   Reply With Quote
Reply

Bookmarks

Thread Tools