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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T22:01:32+00:00 2026-05-14T22:01:32+00:00

Hey guys, I am working on a game, and wanted to add a screen

  • 0

Hey guys, I am working on a game, and wanted to add a screen that would open when the user clicked on certain objects. The screen would be laid out to have an image on the left, a title on the top right, and text below the title.

I have a few problems with this,
1) How would I create the popup box? (preferably with rounded edges)
2) How would I wrap the text (in front of the picture, but not outside the popup-box, I may even need vertical scroll bars)
3) How would I account for different screen resolutions (would they even make a difference?)

Thanks for any and all help,
Max

  • 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-14T22:01:32+00:00Added an answer on May 14, 2026 at 10:01 pm

    the rounded edges etc can be handled best by making an image of what you want the popup to look like and styling it how you want.

    lets say that you made a box, 300px by 300px

    then from there you would want to wrap your text within, and possibly have it scroll or however you want to handle it by checking the text height and width to find where to wrap the text…

    for example you could make a function like this which would take your full text and wrap it based on some measurements.

    private string WrapText(string text)
    {
      string[] words = text.Split(' ');
      StringBuilder sb = new StringBuilder();
      float linewidth = 0f;
      float maxLine = 250f; //a bit smaller than the box so you can have some padding...etc
      float spaceWidth = spriteFont.MeasureString(" ").X;
    
      foreach (string word in words)
      {
        Vector2 size = spriteFont.MeasureString(word);
        if (linewidth + size.X < 250)
        {
          sb.Append(word + " ");
          linewidth += size.X + spaceWidth;
        } 
        else
        {
          sb.Append("\n" + word + " ");
          linewidth = size.X + spaceWidth;
        }
      }
      return sb.ToString();
    }
    

    if your text is to much for a top to bottom view – you would have to come up with some sort of scrolling text, or a “continue” button press to load the next page of text for example.

    finally as far as resolution goes, it depends on the platform, you want to build your game and art towards the platform for example a 300×300 image for a dialog box probably wont work that great if this is something you are building in XNA 4 for a phone, but would be fine for an xbox build, and most logically the pc build. Though with viewports you probably could use the same art (just might be worth it to use smaller images for a much smaller screen.

    for resolution kind of questions you probably want to look at some things like tile safe area, and read a bit about viewports. It’s also suggested that you set your game to run at 1280 x 720 which is a 720p native resolution that should work on all tvs and gives you a reference for your art.

    public Game1()
    {
        graphics = new GraphicsDeviceManager(this);
    
        this.graphics.PreferredBackBufferWidth = 1280;
        this.graphics.PreferredBackBufferHeight = 720;
    
        Content.RootDirectory = "Content";
    }
    

    that should hopefully at least push you in the right direction.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey guys, I have a raidan style 2d flying/fighter game that im working on.
Hey guys. Working on Mac OSX 10.6, My problem is that I would like
Hey guys i am currently working on an android app that will allow me
Hey guys, I'm working on a cakephp app that manages a list of alpha
Hey guys, I'm working on a program for a university course that uses a
Hey guys, Im working with wpf 3d, im currently writing a program that will
Hey guys. I'm working in WinForms and trying to create a ComboBox control that
Hey guys I'm now working on a project that require upload a lot of
Hey guys I'm working on a jQuery code snippet that's suppose to remove a
Hey guys, i'm working on a program that gets a postfix expression and calculates

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.