Resize DHTML (Method): Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
No edit summary
Tag: Reverted
m forgot the space, woops
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<onlyinclude>{{Method|name = Navigate
<onlyinclude>{{Method|name = Resize
|arguments = [[Content]] <var>URL = about:blank</var>
|arguments = [[Integer]] '''Width''', [[Integer]] '''Height'''
|description = Allows the DHTML to load a trusted url. It should be noted that Navigate loads about:blank by default.
|description = Changes the size of the window.
|object = HtmlWindow
|object = HtmlWindow
}}</onlyinclude>
}}</onlyinclude>
Line 7: Line 7:
{{clear floats}}
{{clear floats}}


{{Example|This code will open shirt.png, the default roblox T-Shirt from around 2010:
{{Example|This code will create and then spam resize a DHTML window 1000 times:
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
local HtmlService = game:service("HtmlService")
local HtmlService = game:service("HtmlService")
Line 13: Line 13:


htmlWindow:Show()
htmlWindow:Show()
htmlWindow:Navigate("http://roblox.com/images/shirt.png")
 
for i = 0, 1000 do
    wait(math.random(1, 2))
htmlWindow:Resize(math.random(100, 300), math.random(100, 300))
end
</syntaxhighlight>}}
</syntaxhighlight>}}

Latest revision as of 21:06, 10 November 2023

Resize( Integer Width, Integer Height )
Returns nil
Description: Changes the size of the window.
Member of: HtmlWindow


Example
This code will create and then spam resize a DHTML window 1000 times:
local HtmlService = game:service("HtmlService")
local htmlWindow = HtmlService:NewWindow()

htmlWindow:Show()

for i = 0, 1000 do
    wait(math.random(1, 2))
	htmlWindow:Resize(math.random(100, 300), math.random(100, 300))
end