morioki Posted April 18, 2020 Share Posted April 18, 2020 How to make activation html menu on button? Link to comment Share on other sites More sharing options...
r0uzy Posted April 18, 2020 Share Posted April 18, 2020 could u explain what is ur mission? https://wiki.rage.mp/index.php?title=RAGE.Ui.HtmlWindow Link to comment Share on other sites More sharing options...
morioki Posted April 18, 2020 Author Share Posted April 18, 2020 1 минуту назад, r0uzy сказал: could u explain what is ur mission? https://wiki.rage.mp/index.php?title=RAGE.Ui.HtmlWindow Is it possible on js? Link to comment Share on other sites More sharing options...
r0uzy Posted April 18, 2020 Share Posted April 18, 2020 https://wiki.rage.mp/index.php?title=Browser::Browser Link to comment Share on other sites More sharing options...
morioki Posted April 18, 2020 Author Share Posted April 18, 2020 okay.... how to activate menu? on js Link to comment Share on other sites More sharing options...
Rafikus Posted April 18, 2020 Share Posted April 18, 2020 Somwhere in your code you have to create browser by using mp.browsers.new(<html path>). You can have some event that is called that creates it. Or you can bind it to some key. For example you can have it binded to the key "I": let browser; // 0x49 = I mp.keys.bind(0x49, true, () => { if(browser === undefined) { // Activation of page browser = mp.browsers.new("package://yourpackage/index.html"); mp.gui.cursor.show(true, true); } else { // If browser exist destroy it browser.destroy(); browser = undefined; mp.gui.cursor.show(false, false); } }); Also mp.gui.cursor.show(true, true); makes player uncontrollable with keyboard and mouse, and shows cursor on screen. There might be better way to toggle browser but i use it that way. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now