Steps to reproduce:
1. Execute /createTestBrowser command
2. Try dragging scrollbar
Sample code:
local function getFakeHtml()
iprint("ok")
return "<html><body><h2>Hello world<h2></body></html>"
end
local browser
local size = 200
addCommandHandler("createTestBrowser", function()
browser = createBrowser(size, size, true, false)
setBrowserAjaxHandler(browser, "assets/index.html", getFakeHtml)
addEventHandler("onClientBrowserCreated", browser, function ()
loadBrowserURL(browser, "http://mta/local/assets/index.html")
addEventHandler("onClientRender", root, function()
dxDrawImage(200, 200, size, size, browser)
end)
iprint("created")
end)
end)
addEventHandler("onClientResourceStart", resourceRoot, function()
local scx, scy = guiGetScreenSize()
local width, height = 200, 20
local scroll = guiCreateScrollBar((scx - width)/2, (scy - height)/2, width, height, true, false)
showCursor(true)
addEventHandler("onClientGUIScroll", scroll, function()
local scrollAmount = guiScrollBarGetScrollPosition(scroll)
size = 200 + (scrollAmount/100 * 200)
resizeBrowser(browser, size, size)
end)
end)