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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T13:16:58+00:00 2026-06-14T13:16:58+00:00

I am new to JME3 game engine but I know Android XML GUI layouts

  • 0

I am new to JME3 game engine but I know Android XML GUI layouts pretty good. I have a simple layout here and I cant figure out what is wrong. Here is my XML code:

<?xml version="1.0" encoding="UTF-8"?>
<nifty xmlns="http://nifty-gui.sourceforge.net/nifty-1.3.xsd"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://nifty-gui.sourceforge.net/nifty-1.3.xsd
                       http://nifty-gui.sourceforge.net/nifty-1.3.xsd">

<useControls filename="nifty-default-controls.xml" />
<useStyles filename="nifty-default-styles.xml" />

<screen id="start" controller="com.jasoncrosby.game.farkle.gui.MenuScreenGui">
    <layer id="layer" backgroundColor="#66CD00" childLayout="center">
        <panel id="panel" align="center" valign="center" childLayout="center" visibleToMouse="true">
            <image filename="Textures/wood_floor.png" height="95%" width="95%"/>

            <panel id="panel" align="center" valign="center" childLayout="center" visibleToMouse="true">
                <text text="test" font="Interface/Fonts/Eraser.fnt"></text>
            </panel>
        </panel>
    </layer>
</screen>

Everything works good until I get to displaying the text. I have tried different alignments and tried moving the text into different panels but no matter what I do the text is never in the center of the screen. Its always in the upper left corner so far I can only see the lower right part of the text. I’m sure it has to be something simple but since I’m new to this I’m not noticing anything. Thanks for the help in advance.

  • 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-06-14T13:16:59+00:00Added an answer on June 14, 2026 at 1:16 pm

    You’re probably using an old Nifty version. Your first panel with the id=”panel” uses childLayout=”center” and it has two child elements (an image and another panel). This was not supported in Nifty versions prior to 1.3.1.

    Here is a quote from the Nifty Manual PDF:

    Another thing that has been improved in Nifty 1.3.1 is that
    childLayout=“center“ now supports more than one child element! In
    versions prior 1.3.1 childLayout=“center“ would only support a single
    child elements and odd things would happen to the other elements. This
    has now been improved as well and childLayout=“center“ supports more
    than one child element.

    I’ve tried your XML with Nifty 1.3.2 and the text is in the center of the screen.

    PS: Not related to your problem: It’s not a good idea to use the same id for multiple elements (you have two panels with id=”panel”). Nothing bad will happen (besides a warning in the log) but when you try to do a findElementByName() you might end up with some unexpected element.

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

Sidebar

Related Questions

new to python. so i have this function, and I don't know how to
New Android programmer here. I have a Service which performs socket management and async
New to NodeJS. Yes I know I could use a framework, but I want
new to python. This is probably simple but I haven't found an answer. rndStr
New to PHP and MySQL, have heard amazing things about this website from Leo
new to c#. I'm trying to make a simple system where I can search
New developer here,Im using the Custom Image Picker by ray wenderlich. But what I
New to XML parsing.I need to read a group of arbitrary XML files. They
New to MonoTouch and MonoTouch.Dialog, but I'm sure it's possible to create a tab
New-style status messages (as in mobile apps and web interface) have new properties e.g.

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.