0

I'm having a lil' problem. I am asked to make a game, so now I got the layout, I yet have to make sure that when a CheckBox called 'roteer'; is active, I need to rotate the entire GridPane in which the game is made 180 degrees. For example, I have a square and I want that square to turn everytime I press a button, but only when a checkbox is checked. How do I do this? If you have no idea about the CheckBox, how can I rotate a square?

Thanks in advance :)

Ivar Reukers
  • 7,560
  • 9
  • 56
  • 99
  • What do you mean by "If you have no idea about the `CheckBox`?" – James_D Feb 12 '15 at 16:49
  • Well maybe you don't know how you can declare the fact that the CheckBox is active, but you do know how to rotate a GridPane or a square, that also helps a lot. – Ivar Reukers Feb 12 '15 at 16:51
  • I don't really understand what you are asking. Are you asking how you respond to a button press? Or how you rotate a node? Or how you know if a check box is selected? Perhaps you can post some code to show what you have tried and where you are stuck? – James_D Feb 12 '15 at 16:52
  • The code is like quite big, so explaining it is easier i guess, but I need to rotate a Pane with 10x10 buttons on it 180 degrees, but only when a checkbox is activated. If it is, then it should only rotate when a button is pressed – Ivar Reukers Feb 12 '15 at 17:22
  • Did you give the RotateTransition a try? https://docs.oracle.com/javase/8/javafx/api/javafx/animation/RotateTransition.html – eckig Feb 12 '15 at 17:24
  • Create a [small, complete example](http://stackoverflow.com/help/mcve) (from scratch if necessary) that demonstrates the problem. (For example, rotating a 10x10 array of buttons is the same as rotating two buttons.) It is impossible to say why your code is not doing what you want if you don't show the code. – James_D Feb 12 '15 at 17:30

1 Answers1

0

Thanks to eckig.

RotateTransition worked fine here, thanks a lot!

Ivar Reukers
  • 7,560
  • 9
  • 56
  • 99