<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://www.computercraft.info/wiki/index.php?action=history&amp;feed=atom&amp;title=Window.reposition</id>
		<title>Window.reposition - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://www.computercraft.info/wiki/index.php?action=history&amp;feed=atom&amp;title=Window.reposition"/>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Window.reposition&amp;action=history"/>
		<updated>2026-07-11T07:17:36Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.24.1</generator>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Window.reposition&amp;diff=6364&amp;oldid=prev</id>
		<title>Bomb Bloke at 10:41, 7 April 2014</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Window.reposition&amp;diff=6364&amp;oldid=prev"/>
				<updated>2014-04-07T10:41:33Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 10:41, 7 April 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 15:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 15:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|examples=&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|examples=&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{Example&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{Example&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|desc=Stretches and bounces a small window filled with white around the display.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|desc=Stretches and bounces a small window filled with white around the display &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;until terminated (Ctrl + T)&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|code= local xSize, ySize = term.getSize()&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|code= local xSize, ySize = term.getSize()&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; local xPos, yPos, xLen, yLen = math.random(xSize-5), math.random(ySize-5), math.random(5), math.random(5)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; local xPos, yPos, xLen, yLen = math.random(xSize-5), math.random(ySize-5), math.random(5), math.random(5)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key ccraft_wiki-mw_:diff:version:1.11a:oldid:6363:newid:6364 --&gt;
&lt;/table&gt;</summary>
		<author><name>Bomb Bloke</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Window.reposition&amp;diff=6363&amp;oldid=prev</id>
		<title>Bomb Bloke at 10:38, 7 April 2014</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Window.reposition&amp;diff=6363&amp;oldid=prev"/>
				<updated>2014-04-07T10:38:55Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 10:38, 7 April 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 12:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 12:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;If shrinking a window will result in some of its contents being cropped from view, then that content will be removed from the window's buffer and will ''not'' be restored if you later re-enlarge it. If a new width / height is not specified then the window will retain its previous dimensions.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;If shrinking a window will result in some of its contents being cropped from view, then that content will be removed from the window's buffer and will ''not'' be restored if you later re-enlarge it. If a new width / height is not specified then the window will retain its previous dimensions.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;See also: [[window.getPosition|window.getPosition()]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;See also: [[window.getPosition|window.getPosition&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;()]], [[term.getSize|term.getSize&lt;/ins&gt;()]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|examples=&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|examples=&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{Example&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{Example&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key ccraft_wiki-mw_:diff:version:1.11a:oldid:6362:newid:6363 --&gt;
&lt;/table&gt;</summary>
		<author><name>Bomb Bloke</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Window.reposition&amp;diff=6362&amp;oldid=prev</id>
		<title>Bomb Bloke: Created page with &quot;{{lowercase}} {{Function |name=window.reposition |args={{type|number}} xPosition, {{type|number}} yPosition [&lt;nowiki/&gt;, {{type|number}} width, {{type|number}} height] |returns...&quot;</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Window.reposition&amp;diff=6362&amp;oldid=prev"/>
				<updated>2014-04-07T10:37:39Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{lowercase}} {{Function |name=window.reposition |args={{type|number}} xPosition, {{type|number}} yPosition [&amp;lt;nowiki/&amp;gt;, {{type|number}} width, {{type|number}} height] |returns...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{lowercase}}&lt;br /&gt;
{{Function&lt;br /&gt;
|name=window.reposition&lt;br /&gt;
|args={{type|number}} xPosition, {{type|number}} yPosition [&amp;lt;nowiki/&amp;gt;, {{type|number}} width, {{type|number}} height]&lt;br /&gt;
|returns=None&lt;br /&gt;
|api=term&lt;br /&gt;
|addon=ComputerCraft&lt;br /&gt;
|desc=A function available to window-based [[term (API)|terminal objects]] created via the [[window (API)|window API]], which moves and / or resizes the window in concern.&lt;br /&gt;
&lt;br /&gt;
If [[window.setVisible|visible]], the window will be automatically re-rendered, however the parent terminal object won't be (meaning &amp;quot;ghost&amp;quot; images of the window's previous shape / location may be left behind unless you manually clear them).&lt;br /&gt;
&lt;br /&gt;
If shrinking a window will result in some of its contents being cropped from view, then that content will be removed from the window's buffer and will ''not'' be restored if you later re-enlarge it. If a new width / height is not specified then the window will retain its previous dimensions.&lt;br /&gt;
&lt;br /&gt;
See also: [[window.getPosition|window.getPosition()]]&lt;br /&gt;
|examples=&lt;br /&gt;
{{Example&lt;br /&gt;
|desc=Stretches and bounces a small window filled with white around the display.&lt;br /&gt;
|code= local xSize, ySize = term.getSize()&lt;br /&gt;
 local xPos, yPos, xLen, yLen = math.random(xSize-5), math.random(ySize-5), math.random(5), math.random(5)&lt;br /&gt;
 local xDir, yDir, xLenDir, yLenDir = 1, 1, 1, 1&lt;br /&gt;
 &lt;br /&gt;
 local smallWindow = window.create(term.current(), xPos, yPos, xLen, yLen)&lt;br /&gt;
 smallWindow.setBackgroundColor(colours.white)&lt;br /&gt;
 &lt;br /&gt;
 while true do&lt;br /&gt;
 	sleep(0.2)&lt;br /&gt;
 	&lt;br /&gt;
 	xPos = xPos + xDir&lt;br /&gt;
 	yPos = yPos + yDir&lt;br /&gt;
 	xLen = xLen + xLenDir&lt;br /&gt;
 	yLen = yLen + yLenDir&lt;br /&gt;
 	&lt;br /&gt;
 	term.setBackgroundColor(colours.black)&lt;br /&gt;
 	term.clear()&lt;br /&gt;
 	smallWindow.reposition(xPos, yPos, xLen, yLen)&lt;br /&gt;
 	smallWindow.clear()&lt;br /&gt;
 	&lt;br /&gt;
 	if xPos &amp;lt;= 1 then xDir = 1 end&lt;br /&gt;
 	if xPos + xLen &amp;gt;= xSize + 1 then xDir = -1 end&lt;br /&gt;
 	&lt;br /&gt;
 	if yPos &amp;lt;= 1 then yDir = 1 end&lt;br /&gt;
 	if yPos + yLen &amp;gt;= ySize + 1 then yDir = -1 end&lt;br /&gt;
 	&lt;br /&gt;
 	if xLen &amp;lt;= 1 then xLenDir = 1 end&lt;br /&gt;
 	if xLen &amp;gt;= 5 then xLenDir = -1 end&lt;br /&gt;
 	&lt;br /&gt;
 	if yLen &amp;lt;= 1 then yLenDir = 1 end&lt;br /&gt;
 	if yLen &amp;gt;= 5 then yLenDir = -1 end&lt;br /&gt;
 end&lt;br /&gt;
}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:API_Functions]]&lt;/div&gt;</summary>
		<author><name>Bomb Bloke</name></author>	</entry>

	</feed>