HU/resizeBrowser

From Multi Theft Auto: Wiki
Revision as of 11:45, 11 August 2018 by WorthlessCynomys (talk | contribs) (Created page with "__NOTOC__ {{Client function hu}} {{New feature/item|3.0153|1.5.3|9912| Lehetővé teszi a CEF böngészők méretezését futás közben. }} {{Warning|Do '''not''' use this f...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Lehetővé teszi a CEF böngészők méretezését futás közben.

Dialog-warning.png Warning: Do not use this function with onClientRender as it re-creates the underlying texture internally (which is an expensive operation).

Syntax

bool resizeBrowser ( browser webBrowser, float width, float height )

Required Arguments

  • webBrowser: The browser you want to resize.
  • width: The new width of the browser.
  • height: The new height of the browser.

Returns

Returns true if the browser is resized successfully, false if there's something wrong.

Example

Example for resize browser by command.


screenWidth, screenHeight = guiGetScreenSize()
initBrowser = guiCreateBrowser(0, 0, screenWidth, screenHeight, true, true, false)
addCommandHandler("resize",
	function ( cmd, width, height )
		local browser = guiGetBrowser(initBrowser)
		local width, height = tonumber(width), tonumber(height)
		resizeBrowser( browser, width, height )
	end
)

See Also

GUI Függvények


Fordította

  • WorthlessCynomys