Wrox Programmer Forums
| 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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #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



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





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.