Jump to content

  • Log In with Google      Sign In   
  • Create Account


Setting the Viewport for rendering


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 Shashwat Rohilla   Members   -  Reputation: 130

Like
0Likes
Like

Posted 20 February 2012 - 12:57 PM

I'm using XNA 4.0 in VS 2010

Please tell me how to set a particular part of the screen for rendering.
eg I want to use 70% of the screen for 3D rendering (left side) and rest 30% (right side) for displaying the scores and other information.

I tried to use change some variables but they were all read-only.
Thanks

Sponsor:

#2 Washu   Senior Moderators   -  Reputation: 5001

Like
0Likes
Like

Posted 20 February 2012 - 02:26 PM

http://msdn.microsoft.com/en-us/library/microsoft.xna.framework.graphics.graphicsdevice.viewport.aspx

Might help

In time the project grows, the ignorance of its devs it shows, with many a convoluted function, it plunges into deep compunction, the price of failure is high, Washu's mirth is nigh.
ScapeCode - Blog | SlimDX


#3 Shashwat Rohilla   Members   -  Reputation: 130

Like
0Likes
Like

Posted 27 February 2012 - 06:52 AM

It helped me.
I was able to create two different viewports.
But I wanted to color both of them with different backgrounds.
I used GraphicsDevice(Color.Green) after setting it to different viewports but it renders the whole window (not just the specified viewport).




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS