Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Professional XNA Game Programming: For Xbox 360 and Windows ISBN: 978-0-470-12677-6
This is the forum to discuss the Wrox book Professional XNA Game Programming: For Xbox 360 and Windows by Benjamin Nitschke; ISBN: 9780470126776
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional XNA Game Programming: For Xbox 360 and Windows ISBN: 978-0-470-12677-6 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 5th, 2007, 08:57 PM
Registered User
 
Join Date: May 2007
Location: bangkok, bangkok, Thailand.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to change game window size ?

Maybe this is really simple question.. But I just could not find how to do it.. How can i change the game window size???

I tried to play around with this.Window.ClientBounds but cannot set (only get available)..


  #2 (permalink)  
Old May 6th, 2007, 03:16 AM
Registered User
 
Join Date: May 2007
Location: Belgrade, , Yugoslavia.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to ForensicBroom
Default

You should play with graphicsDeviceManager.PreferedBackBufferWidth and height...

  #3 (permalink)  
Old May 6th, 2007, 06:20 AM
Registered User
 
Join Date: May 2007
Location: bangkok, bangkok, Thailand.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for reply, ForensicBroom..
I tried to put

            graphics.PreferredBackBufferWidth = 512;
            graphics.PreferredBackBufferHeight = 512;

within Initialize() but still nothing changed!! Any idea??

  #4 (permalink)  
Old May 7th, 2007, 05:52 AM
Registered User
 
Join Date: May 2007
Location: , , .
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Is 512x512 a supported resolution on your graphics card? My guess would be that it's not. Try something more standard like 640x480 or 800x600.

  #5 (permalink)  
Old May 7th, 2007, 11:48 AM
Registered User
 
Join Date: May 2007
Location: bangkok, bangkok, Thailand.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hmm... What if I would like to create a simple board game in the window (let's assume I don't care about xbox). Is that possible to set window size to 512 x 512 or I should better do it with "window application" instead of "window game" project.

  #6 (permalink)  
Old May 7th, 2007, 05:58 PM
Registered User
 
Join Date: May 2007
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

in public game1()
you will see this
  graphics = new GraphicsDeviceManager(this);
all you need to do from there is add your new settings

    graphics.PreferredBackBufferHeight = 400;
            graphics.PreferredBackBufferWidth = 600;

EDIT:
I Don't think it matters exactly what size you make your window as long as it is lower then the bounds of your screen rez. In other words, you can't set it to 860*680 if your rez is 800*600

[/quote]

  #7 (permalink)  
Old May 7th, 2007, 06:59 PM
Registered User
 
Join Date: May 2007
Location: bangkok, bangkok, Thailand.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks ijoemomma !!
Problem solved...
What I need to do is adding the following code in the Initialized() to have my game window with size 123 x 456...

            graphics.PreferredBackBufferWidth = 123;
            graphics.PreferredBackBufferHeight = 456;
            graphics.IsFullScreen = false;
            graphics.ApplyChanges();


  #8 (permalink)  
Old May 7th, 2007, 07:25 PM
Registered User
 
Join Date: May 2007
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default


i didn't add anything to the initialized method. But if it worked for you then that's good.

Now if i can only get rid of this cold and get back to the book

 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Customizing the window size tenvuong BOOK: Ivor Horton's Beginning Visual C++ 2005 0 March 31st, 2008 09:16 AM
Browser window: Specifying the size and location? asearle HTML Code Clinic 2 November 22nd, 2007 08:50 AM
Window or Page size ckrajeshvarma ASP.NET 2.0 Professional 0 August 6th, 2006 12:53 AM
Window Size ckrajeshvarma ASP.NET 2.0 Basics 0 August 6th, 2006 12:50 AM
Can I force a browser's window size chrscote Javascript How-To 2 May 27th, 2005 03:13 PM



All times are GMT -4. The time now is 01:28 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.