Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6635865
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:06:39+00:00 2026-05-25T23:06:39+00:00

Using XNA, I’m trying to make an adventure game engine that lets you make

  • 0

Using XNA, I’m trying to make an adventure game engine that lets you make games that look like they fell out of the early 90s, like Day of the Tentacle and Sam & Max Hit the Road. Thus, I want the game to actually run at 320×240 (I know, it should probably be 320×200, but shh), but it should scale up depending on user settings.

It works kind of okay right now, but I’m running into some problems where I actually want it to look more pixellated that it currently does.

Here’s what I’m doing right now:

In the game initialization:

    public Game() {
        graphics = new GraphicsDeviceManager(this);
        graphics.PreferredBackBufferWidth = 640;
        graphics.PreferredBackBufferHeight = 480;
        graphics.PreferMultiSampling = false;

        Scale = graphics.PreferredBackBufferWidth / 320;
    }

Scale is a public static variable that I can check anytime to see how much I should scale my game relative to 320×240.

In my drawing function:

spriteBatch.Begin(SpriteSortMode.BackToFront, BlendState.NonPremultiplied, SamplerState.PointClamp, DepthStencilState.Default, RasterizerState.CullNone, null, Matrix.CreateScale(Game.Scale));

This way, everything is drawn at 320×240 and blown up to fit the current resolution (640×480 by default). And of course I do math to convert the actual coordinates of the mouse into 320×240 coordinates, and so forth.

Now, this is great and all, but now I’m getting to the point where I want to start scaling my sprites, to have them walk into the distance and so forth.

Look at the images below. The upper-left image is a piece of a screenshot from when the game is running at 640×480. The image to the right of it is how it “should” look, at 320×240. The bottom row of images is just the top row blown up to 300% (in Photoshop, not in-engine) so you can see what I’m talking about.

image showing the difference in scaling as the resolution changes

In the 640×480 image, you can see different “line thicknesses;” the thicker lines are how it should really look (one pixel = 2×2, because this is running at 640×480), but the thinner lines (1×1 pixel) also appear, when they shouldn’t, due to scaling (see the images on the right).

Basically I’m trying to emulate a 320×240 display but blown up to any resolution using XNA, and matrix transformations aren’t doing the trick. Is there any way I could go about doing this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T23:06:39+00:00Added an answer on May 25, 2026 at 11:06 pm

    Render everything in the native resolution to a RenderTarget instead of the back buffer:

            SpriteBatch targetBatch = new SpriteBatch(GraphicsDevice);
            RenderTarget2D target = new RenderTarget2D(GraphicsDevice, 320, 240);
            GraphicsDevice.SetRenderTarget(target);
    
            //perform draw calls
    

    Then render this target (your whole screen) to the back buffer:

            //set rendering back to the back buffer
            GraphicsDevice.SetRenderTarget(null);
    
            //render target to back buffer
            targetBatch.Begin();
            targetBatch.Draw(target, new Rectangle(0, 0, GraphicsDevice.DisplayMode.Width, GraphicsDevice.DisplayMode.Height), Color.White);
            targetBatch.End();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using XNA and creating a bunch of forms that roll their own 'game
I recently decided to learn and make small 2D game using XNA framework. So
I would like to write a 2D real time strategy game probably using XNA
I'm making a 3D game in XNA using Ox Engine. There is very little
I'm planning to do a simple game using the XNA and I would like
I'm trying to develop an app using XNA and for state management I'm using
I'm developing a game using XNA and C# and was attempting to avoid calling
I'm writing an XNA game in C# using the XNA port of Box2d -
in my spare time I'm engaged with writing a little game using Microsofts XNA
I'm so close! I'm using the XNA Game State Management example found here and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.