Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use controllers in the menus #596

Closed
Grise3 opened this issue Feb 27, 2024 · 7 comments
Closed

Use controllers in the menus #596

Grise3 opened this issue Feb 27, 2024 · 7 comments
Labels
support Usage questions

Comments

@Grise3
Copy link

Grise3 commented Feb 27, 2024

Hello,
My question is : How can we use a controller with RmlUI?
I already readed this :
https://mikke89.github.io/RmlUiDoc/pages/rcss/user_interface.html#nav

#142
I'd like to do something like this too :

But, after reading, I don't understand how to use it...
Can I have examples of code please?

@mikke89 mikke89 added the support Usage questions label Feb 27, 2024
@mikke89
Copy link
Owner

mikke89 commented Feb 27, 2024

Hey, there. Certainly, I understand some more examples could be useful. What did you try so far?

For that screenshot, let's say we have this conceptual RML code:

<tab>Game</tab>
<tab id="video">Video</tab>
...
<panel>
  <p>Fullscreen mode:</p><select id="fullscreen_mode">...</select>
  <p>Gui scale:</p><input type="range"/>
  <p>Last option</p><input type="text" id="last"/>
</panel>
<button id="ok">
<button id="cancel">

I would perhaps start with something like this:

tab { nav: horizontal; }
tab#video { nav-down: #fullscreen; }

select, input { nav: vertical; }
#fullscreen_mode { nav-up: #video; }
#last { nav-down: #ok; }

button { nav: horizontal; }
button#ok { nav-up: #last; }

How does that look to you?

I'd be interested to see a fully operational example like in the screenshot. So please share how it works out for you.

@Grise3
Copy link
Author

Grise3 commented Feb 28, 2024

Well, I think that what I want is more difficult. look :

in his screenshot you have some menus of the game.
Screenshot_20240228_095501
here is a little part of the UI code :

the ingame menu :

http://51.178.51.166/grise/other/menu_ingame.rml

the option menu :
http://51.178.51.166/grise/other/options.rml

and the 'key bindings' menu :

http://51.178.51.166/grise/other/options_keys.rml

what i would like to do is :

Screenshot_20240228_095501

I'd like a "joy stick navigation" i mean: if I use the joystick for go At the top it goes at the top ect.

Do you understand?

@mikke89
Copy link
Owner

mikke89 commented Feb 28, 2024

Hm, first of all, I think you shouldn't shy away from scripting some of the behavior you want. Maybe you could use nav within a panel, and some other behavior between panels for example.

Be aware that the nav property can't navigate between documents if that is how the panels are organized here. If they are all in the same document though, I guess it should work fine to use e.g. nav-right on your top left-menu to move to the "bot tactic" menu, and so on. The nav properties are very new, so if there are some additions that could help out then let us know. But don't try to fit the square peg everywhere, there are many approaches here.

I'd like a "joy stick navigation" i mean: if I use the joystick for go At the top it goes at the top ect.

Not sure I follow, can you rephrase this?

@Grise3
Copy link
Author

Grise3 commented Feb 29, 2024

Hello! What you mean is : for use the controller to menus, I can't have the menus in multiple files?

Not sure I follow, can you rephrase this?

Well, I don't want that you are stuck with the menus.
I'm going to try to do an example : if with the joystick I put it in the 'top' position, in my menus it go one 'level' in the top of the menu, if I put it in the 'left' position, it go to the left menu, the menu that it is not far from the menu that it is before change...

Do you understand? If you don't, I can make a little video for show you ;) with my current menu and the comportements :)

If I understand correctly, currently you 'set' for example : this button go to this and this button is used for go to this... Well... I try to make this little example :

1️⃣ 2️ 3️⃣---------7️⃣
4️⃣ 5️⃣---------------6️⃣
-------------------------8️⃣

All this are buttons. For example, by default we are on the button '7'.if I want to go on the button '3' I use the joystick in the position 'left' now if I'm in another button like '7', '6', '8'and that I want to go in the buttons in the left, I just use the joystick in the position' left' and it go in the left position, At the nearest button. It is not like, for go in the button '1' and that currently I'm in the button '7' I have to go to the '6', and after the '8', and after it go in the '1'

Is this explanation more... Comprehensive?

@Grise3
Copy link
Author

Grise3 commented Mar 4, 2024

I did this, for explain. Don't paid attention to the mouse
https://github.com/mikke89/RmlUi/assets/148749571/6069c333-2e36-4858-82db-1641675a6b19

@mikke89
Copy link
Owner

mikke89 commented Mar 5, 2024

Hello! What you mean is : for use the controller to menus, I can't have the menus in multiple files?

Sure you can, but the nav feature won't work between them. You will have to navigate between documents using scripting.

I feel like you're making this more complicated than it is? Instead, I would suggest that you just try out different approaches, using nav where you can, or manual scripting where that makes sense.

Please experiment a bit with that, and maybe create some examples or prototypes. Once you have that, if there is some particular behavior you find unexpected or unable to make it work as desired, then let us know and post what you have so far.

@mikke89 mikke89 closed this as completed Apr 6, 2024
@Grise3
Copy link
Author

Grise3 commented Apr 7, 2024

Hi and sorry for my last reply ( a lot of family problems)

I feel like you're making this more complicated than it is?

Lol I agree. And my currents menus are pretty bad

Please experiment a bit with that, and maybe create some examples or prototypes. Once you have that, if there is some particular behavior you find unexpected or unable to make it work as desired, then let us know and post what you have so far.

OK!
Well, in reality I would like to do something like this :
https://user-images.githubusercontent.com/1159464/103571522-4f423a00-4ecb-11eb-9b48-0c52ba0d3fb2.png

Menus like this. I think that this will be the better. I'm not sure to understand fully, do you think that if all the menus are in a same file, it would be better for controller navigation?

Do you know if a game that use RmlUI can use controllers? I mean, do you know a game that I could see the code for make my menus?

Be sure, @mikke89 If I manage to make menus that work well and don't have windows, I'll send you source code with screenshots so you can do documentation with examples!

My current goal would be : have menus that can be used with a coutroller, that have a thing like a "screenmanager" I mean, no windows, like on the screenshot.

I think that this would be more easy with examples XD

Well something that could be for me, can you send me a link to the UI code of this game : https://mikke89.github.io/RmlUiDoc/pages/animations/game_main_menu.webm
And if you have, a link to a game that use RmlUI and that can use controllers, if you don't have a little example :D
Thanks for had replied to me.

Aigain, I' really sorry for my last reply :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support Usage questions
Projects
None yet
Development

No branches or pull requests

2 participants