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

  • Home
  • SEARCH
  • 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 7575873
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T16:47:07+00:00 2026-05-30T16:47:07+00:00

I have to write an XNA game for a project in my college program.

  • 0

I have to write an XNA game for a project in my college program. I’m making a turn-based RPG in the vein of the Gameboy Pokemon games. I’d like to align the menu options with a container at the bottom of the screen, with never more than 4 options. This should give you a rough idea about how I want the combat screen to look:

Pokemon Battle Image

I currently have a menu system that aligns all the menu items with the center of the screen, meaning menus end up looking like this:

Start Game
Options
Quit

but in the center of the screen.

What is the best way to position the menu items in a similar fashion to the image above? Should I hardcode in the positions for the menu items, should I try and make some kind of class to act as the container for these items and have their position be relative to the size and position of the container, or use some other method?

  • 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-30T16:47:09+00:00Added an answer on May 30, 2026 at 4:47 pm

    If you don’t want to hardcode the positions it could get pretty complex, depending on how much flexibility you want.

    I would create a container class which is part of a tree structure, (see scene graph), with a parent container and a list of child containers. That is the most common way of handling relative positioning. Here a quick example:

    public class Container
    {
        public Container Parent { get; set; }
    
        public List<Container> Children { get; set; }
    
        public Vector2 RelativePosition { get; set; }
    
        public Vector2 AbsolutePosition
        {
            get
            {
                // The container is the root node
                if (Parent == null)
    
                    return RelativePosition;
    
                else
    
                    return RelativePosition + Parent.AbsolutePosition;
            }
        }
    }
    

    If you need even more flexibilty you could create a floated layout, where the elements are positioned dynamically depending on their size.

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

Sidebar

Related Questions

I have developed a little game using XNA 4.0 and C# (new Project->Windows Game
I've got a medium scale project (a turn-based game) that's currently written in C/C++.
I'm new to XNA game development and I have just started to write a
I'm making a game for my final project in an XNA class I'm taking,
I have a problem in the game I wrote with XNA. I recently added
I'm making a multiplayer game in XNA 4.0, using the .NET socket classes. Since
I have write some code but my program is too slow. The problem is
I have develop an XNA game on computer 1. When I send it to
I have been designing a component-based game library, with the overall intention of writing
I'm currently creating a tower defense game using C# & XNA. The games runs

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.