How can you reload or refresh a scene with javafx 1.3

我的梦境 提交于 2020-01-16 19:04:06

问题


i'm making a "memorie" game with javafx 1.3.

(I'm not really good in English but i will try it.)

The main question is, how can I reload a scene after a scene change. And with reload I mean the code will be done again. Because I've four scenes, and all the scenes stay on false but the scene I show stays on true. But one of the scenes have to reload again to make the game right.

So The game has 16 rectangles wich are closet, underneath them there are 8 different pictures from every are twice. But when you found all the 8 couples, and the next scene with congratulations is shown. You have the option to go to menu and restart the game again. But with the shuffle he only shuffles the names from the pictures and not the pictures them selfs. So when you play the game again you have the same pictures but different names en the couples aren't right anymore. So I want to reload or refres the scene so that the code will be read again by the programm and to make it right. I've been looking a lot on the internet but I couldn't find it and especially not in javafx 1.3. Al lot of new good functions are from 2.2 and I can only use that if it's comperable with the 1.3

I don't know if someone can help me better with the code, if it is, you can tell me and I will post it. But the variable names and things are in dutch, so I don't know that you can understand it.

Thankyou for reading and I hope that someone knows how to do it.


回答1:


Well, we can not help you on an idea you have. You also asked more than one question. On the sorting thing I can't help you.

For the transition between different scenes you will find a very nice and handy tutorial here Transition between different stages

There is also a youtube tutorial to this article if you prefer it.

About the sorting I can't help you. You might want to to post your code here and maybe change your variablesnames to english.

Why can you use only javafx1.3. All you need to download is a jar. You always should use the current version.

I hope I could help you a little bit - at least with the tutorial



来源:https://stackoverflow.com/questions/16102545/how-can-you-reload-or-refresh-a-scene-with-javafx-1-3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!