How to change scene with 2-step button method in cocos2d? - menu

Two buttons are in the main menu.
First button is for choosing a game,
and second button is to playing that game.
It's simple to just touch+play. But I don't know how to separate these steps.
How can I store this parameter(selected game) and send it to the method(replaceScene)?

Use CCMenu to create two buttons. Show different scene on pressing those two buttons.

Learn how to handle global data with singletons! Solved.
Great tutorial by Bob!
http://bobueland.com/cocos2d/2011/how-to-make-scenes/

You probably won't need this but for all else having this same issue, use CCMenu. Here is a link to the CCMenu class documentation.
http://www.cocos2d-iphone.org/api-ref/0.99.3/interface_c_c_menu.html
Their documentation is quite useful. Take some time and read and read through documentation and the other useful instruction they have on their site.

Related

Combox nested within another Combobox

Using wxPython, is it possible to nest a combobox inside other combobox in a similar way to how submenus are nested within menus? I need something similar for a wx.Combobox or a wx.Choice.
Or is there any widget with which this can be done?
Well, there are some possibilities:
wx.lib.combotreebox.ComboTreeBox
wx.combo.OwnerDrawnComboBox
# possibly also:
wx.lib.popupctl
You might also use a button (or some control) to invoke a PopupMenu. It may be confusing for the user though, and you might get into trouble when trying to position the Popup menu correctly. Generally speaking, I advice not to be too creative when making UI.
Have you seen wxpython demo? It is a nice showcase of all possible widgets. You can obtain it from here: https://extras.wxpython.org/wxPython4/extras/

Hiding the Hamburger while in shell using template10

Sorry if my query's a bit noobish, a uwp beginner here.
I'm trying to morph the hamburger template from template10 and an existing project of mine. Basically, I'd like to have a certain page with the hamburger menu being invisible, and display my own navigation buttons on the page (an intro page). Upon navigation away to any other page the menu will be visible again.
I tried changing Hamburger's visibility state as an experiment, but it seems to be affecting the content as well. Is what I'm talking about possible with this control and I'm missing something obvious? Or I'd have to manage shell usage in app.xaml and load my intro page without the shell?
Many thanks for the creation of the t10 btw (Jerry, Daren and everyone else), me being confused in this thing doesn't at all diminish my appreciation
There are a few options for you here. IsPaneOpen will only work for you depending on the DisplayMode you choose. But if I were to guess, it's HamburgerMenu,.IsFullScreen that you are really wanting to use here.
You can change the SplitView mode to Inline and set IsPaneOpen to false. That will hide the Pane.

Menu Button that does not dismiss options onclick in JavaFX 2

I am quite new in JavaFX and I have a question about the design. I am creating my main menu in FXML using Scene Builder. I have various menu buttons and each of these have a sub-menu. These sub-menu options will open new windows. Is it possible to declare these submenu choices so they do not dissapear after I click on them? If so, can I declare it in my fxml or I have to do it programatically?
Also, is it possible to detach it from the menu button? I would like to have my menu choices around 1 cm away from the menu button itself.
Thank you
Suggested Alternate Solution
If you want more flexibility in positioning a popup menu after a button click as well as fine control over when the menu shows and hides, try using a Button + a ContextMenu rather than a MenuButton.
The relevant methods are:
contextMenu.show(anchorNode, side, dx, dy)
contextMenu.hide()
There is sample code for triggering a context menu on a button press button in the ContextMenu javadoc.
You might also need to monitor the context menu's showingProperty and in a listener show the menu again if the JavaFX system has decided to try and hide it after some user action and you still want the menu visible.
Answers to additional unrelated comments
OK It sounds logical, yet since Im not really good in JavaFX yet, your Idea is quite challenging.
It's not that hard to implement, but from your subsequent comments it sounds like it's probably not the user interface you want for your users anyway (which makes sense to me because the interface you describe in your question seems a little strange).
I thought If it would be easier to have a static xml that have various menu choices, lets say aligned to the right and then whenever I click one of the choices, a new FXML would be loaded in the middle of the screen holding buttons for a submenu?
That seems logical. Sounds like a JavaFX version of a traditional web page layout with a navigation menu on the side controlling a content pane in the center.
A Java only version of that is: How to have menus in java desktop application. You could adapt that to a FXML based version without too much difficulty.
You might also be interested in Managing Multiple Screens in JavaFX.
Also, any tutorial for beginners would be greatly appreciated. These Oracle ones dont make too much sense for me
If you are beginning JavaFX, I recommend using just the Java API portions of JavaFX until you become familiar with them, and then use FXML only after you are comfortable with the Java API.
Personally, I think the Oracle JavaFX Tutorials are excellent. The difficulty for beginners is that the tutorials are also part reference material, which complicates portions of them (especially the deployment related pieces).
If you prefer a different tutorial style see:
Makery JavaFX tutorial (good for beginners)
zenjava tutorials (more advanced)

How to define global hotkeys for rich:tree element in RichFaces

I have a problem.
I am using rich:tree element for representing menu in my application.
This tree is always present on the page.
What I would like to do is to define global hotkeys like : CTRL+UP, CTRL+DOWN with which user could automatically go from current menu item to another item.
Hope you understand what I mean.
Now, defining hotkeys is no problem.
I use rich:hotKey.
But what to put in their handler?
Anyone got some experience with this problem?
Guide in the right direction, some help, anything would do.
I'm kind of stuck right now.
Thanks!
RichFaces Showcase is not enough?Working with HotKeys is described here and this tutorials leads to ComponentControl which offers a lot of ways how to react on some key event.

UIButton Strange Issue (wont release on releasing tap)

I have a problem with UIButton and it is bizarre because I do not have it on similar occasions in new projects. My problem:
I have four UIButton(s), when you hold your finger on one of them them, then when you tap on another button, even if you release your finger from the second button, until you release all the fingers from the screen, the buttons will not release. I guess that it is related to TouchEvents and TouchGestures like swipe and I am using all of them in my application.
Sincerely yours,
Peyman Mortazavi
I myself found the issue.
You need to make a separate panel inside of the main panel (let's say Root) and then put your buttons or any other UI there.
Regards,
Peyman Mortazavi

Resources