r0uzy Posted April 18, 2020 Posted April 18, 2020 could u explain what is ur mission? https://wiki.rage.mp/index.php?title=RAGE.Ui.HtmlWindow
morioki Posted April 18, 2020 Author 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?
r0uzy Posted April 18, 2020 Posted April 18, 2020 https://wiki.rage.mp/index.php?title=Browser::Browser
Rafikus Posted April 18, 2020 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.
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