Setting the Viewport for rendering

Started by
1 comment, last by Shashwat Rohilla 12 years, 1 month ago
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
Advertisement
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.

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).

This topic is closed to new replies.

Advertisement