Difference between revisions of "Window.create"
From ComputerCraft Wiki
Bomb Bloke (Talk | contribs) (Created page with "{{lowercase}} {{Function |name=window.create |args={{type|table}} parentTerm, {{type|number}} x, {{type|number}} y, {{type|number}} width, {{type|number}} height [<nowiki/>, {...") |
MKlegoman357 (Talk | contribs) m (Added links in example) |
||
(One intermediate revision by one other user not shown) | |||
Line 8: | Line 8: | ||
|desc=Returns a terminal object that is a space within the specified parent terminal object. This can then be used (or even [[term.redirect|redirected to]]) in the same manner as eg a [[peripheral.wrap|wrapped]] [[monitor]]. Refer to the [[Term (API)|term API]] for a list of functions available to it.<br><br> | |desc=Returns a terminal object that is a space within the specified parent terminal object. This can then be used (or even [[term.redirect|redirected to]]) in the same manner as eg a [[peripheral.wrap|wrapped]] [[monitor]]. Refer to the [[Term (API)|term API]] for a list of functions available to it.<br><br> | ||
− | [[Term (API)|term]] itself may not be passed as the parent, though [[term.native|term.native()]] is acceptable. Generally, [[term.current|term.current()]] or a wrapped monitor will be most suitable, though windows may even have other windows assigned as their parents. | + | [[Term (API)|term]] itself may not be passed as the parent, though [[term.native|term.native()]] is acceptable. Generally, [[term.current|term.current()]] or a wrapped monitor will be most suitable, though windows may even have other windows assigned as their parents. New windows are [[window.setVisible|visible]] by default. |
|examples= | |examples= | ||
{{Example | {{Example | ||
− | |desc=Defines a | + | |desc=Defines a 20 width and 10 height window within the current terminal display at X:15/Y:5, then fills it with white. |
− | |code= local myWindow = window.create(term.current(),15,5,20,10) | + | |code= local myWindow = window.create([[term.current]](),15,5,20,10) |
− | myWindow.setBackgroundColor( | + | myWindow.[[term.setBackgroundColor|setBackgroundColor]]([[colors]].white) |
− | myWindow.clear() | + | myWindow.[[term.clear|clear]]() |
}} | }} | ||
}} | }} | ||
[[Category:Lua_Core_Functions]] | [[Category:Lua_Core_Functions]] |
Latest revision as of 19:25, 9 April 2014
Function window.create | |
Returns a terminal object that is a space within the specified parent terminal object. This can then be used (or even redirected to) in the same manner as eg a wrapped monitor. Refer to the term API for a list of functions available to it. term itself may not be passed as the parent, though term.native() is acceptable. Generally, term.current() or a wrapped monitor will be most suitable, though windows may even have other windows assigned as their parents. New windows are visible by default. | |
Syntax | window.create(table parentTerm, number x, number y, number width, number height [, boolean visible]) |
Returns | table terminal object |
Part of | ComputerCraft |
API | window |
Examples
Example | |
Defines a 20 width and 10 height window within the current terminal display at X:15/Y:5, then fills it with white. | |
Code |
local myWindow = window.create(term.current(),15,5,20,10) myWindow.setBackgroundColor(colors.white) myWindow.clear() |