This week's book giveaway is in the Java in General forum.
We're giving away four copies of Event Streams in Action and have Alexander Dean & Valentin Crettaz on-line!
See this thread for details.
Win a copy of Event Streams in Action this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Back button not appearing in help state or (screen) Please help

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am a student learning Java. I recently developed a game in Java and now I am trying to develop a Menu for my game. In my Menu, everything is working fine. When I press play, the game starts, and when I press help, the game enters the help screen. My problem occurs when I'm in the help screen as I'm trying to create a back button that takes the user back to the Main Menu, but the back button does not appear in the help screen.

I tried to make an if statement, but it didn't work the way I intended it to.


Here is my code MenuState:






HelpState


 
Marshal
Posts: 65053
247
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch Please explain how you are adding the back button to the help menu. Is it a popup?
Thank you for using the code button, but your lines are too long to read the whole of.

I think this discussion would fit better in our FX forum. Moving.

Never write == true or == false which are both poor style and error‑prone if you mistakenly write =.
Never if (b == true) ...
Always if (b) ...
Never if (b == false) ...
Always if (!b) ...
Always use {} around your if statement bodies.

Why are you setting anything to null? (line 20) Please post exactly the same code as you  are having problems with; I can see where you haven't copied it correctly.
 
Honey Tripathi
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Ritchie
Thanks for your reply ,No the buttons are not Popups buttons  instead they always appear on screen  

And ya i  will consider and try to implement suggestion for If statement   to improve my code ....

And On line 20  I am setting the  Setting the

UIManager to null

for Making the same button unclickable after you enter to the Game State(Screen)
or  HelpState (Screen )
 
Campbell Ritchie
Marshal
Posts: 65053
247
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Honey Tripathi wrote:. . . On line 20  I am setting the . . .

UIManager to null

for Making the same button unclickable . . .

I don't know enough FX tto be sure, but it is usually a mistake to set anything to null. Maybe there is a clickable property you can set false instead.
You still haven't explained how you are creating the back button.
 
Honey Tripathi
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Ritchie

Thanks for your reply again .This is My UIManager Script  ... Tell me if you need to see any other script from my project


 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!