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 6816567
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:56:29+00:00 2026-05-26T20:56:29+00:00

I created a simple 2D game in XNA for Windows and Xbox. I’m in

  • 0

I created a simple 2D game in XNA for Windows and Xbox. I’m in the process of porting this game to Silverlight 5 (at the time of this writing, still in RC), which supports SpriteBatch, Texture2D, and all sorts of other XNA goodies that I’m using in my game. I successfully ported most of my code to Silverlight, but I’m still struggling with resolution/sizing issues.

My original code and content are configured to work at a resolution of 1280×720 — and I want to keep it that way — but I want to embed the Silverlight game on a webpage at a more manageable size: 640×360 (half of its original size).

So my question is this: How can I shrink an entire Silverlight app to 50% of its original size?

I think I’m on the right track, but I can’t quite get it working. I discovered the RenderTransform and ScaleTransform XAML elements, and they seem to almost accomplish what I’m looking for, but not quite. My XAML looks like this:

<!-- Some attributes omitted for brevity -->
<UserControl x:Class="Silverlight3dApp.MainPage"
  d:DesignWidth="1280"
  d:DesignHeight="720">

  <Grid x:Name="LayoutRoot" Background="White">
    <Grid.RenderTransform>
      <ScaleTransform x:Name="Scale" ScaleX="0.5" ScaleY="0.5" />
    </Grid.RenderTransform>
    <DrawingSurface x:Name="myDrawingSurface" Draw="myDrawingSurface_Draw" />
  </Grid>
</UserControl>

And my HTML object looks like this:

<object data="data:application/x-silverlight-2,"
  type="application/x-silverlight-2"
  width="640"
  height="360">
  <!-- etc. -->
</object>

So the embedded HTML object is set to 640×360 (as desired), and the Silverlight app is set to 1280×720 but then scaled to 0.5 for both ScaleX and ScaleY. This kind of works; the app is being scaled down to 50% size, but the content that’s drawn is cropped. I can only see the upper left quadrant, so I only see 320×180 worth of content (what would have been 640×360 at the original size).

The X’s in this crude drawing represent where I see content in the Silverlight embedded object, everything else is abruptly cropped and empty:

 ___________
|XXXXX      |
|XXXXX      | 360px
|           |
|___________|
    640px

I’m a Silverlight noob, so I have a feeling I’m missing something obvious. Any ideas?

  • 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-26T20:56:30+00:00Added an answer on May 26, 2026 at 8:56 pm

    I think with the way the XNA integration works you’ll need to actually draw at 50% size. This is pretty easy to do if you’re using SpriteBatch, just use the overload of Begin that lets you specify a Matrix:

    spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend,
        SamplerState.LinearClamp, DepthStencilState.None, 
        RasterizerState.CullCounterClockwise, null, Matrix.CreateScale(.5f));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I created a simple Tic Tac Toe game in c#, which can played in
I have created a simple XNA Windows Class Library with XNA 4.0 called NivekGameEngine.
I'm writing a simple game in XNA and I've faced a problem with delegates.
We've created a simple game as an iframe application for facebook and we now
Could someone help me on this, I have created simple web services using axis2
I am writing a map editing program for a 2D game using XNA. To
Lets say i have created a small game with XNA. Now i can change
Since this is just my second game, I'm still a little unsure of how
I have created a simple flash game similar to shooting balloons. You can find
I've created a Form with a simple game. The game requires input from the

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.