http://www.computercraft.info/wiki/index.php?title=Window.redraw&feed=atom&action=historyWindow.redraw - Revision history2024-03-28T17:12:44ZRevision history for this page on the wikiMediaWiki 1.24.1http://www.computercraft.info/wiki/index.php?title=Window.redraw&diff=6374&oldid=prevBomb Bloke at 12:31, 9 April 20142014-04-09T12:31:36Z<p></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;'>
<td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 12:31, 9 April 2014</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 10:</td>
<td colspan="2" class="diff-lineno">Line 10:</td></tr>
<tr><td class='diff-marker'> </td><td style="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;"><div>Generally this is handy if one window has written content over the top of the top of another (of which it is ''not'' a child), and you wish to bring the content of the covered window back to the fore-front of your display.</div></td><td class='diff-marker'> </td><td style="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;"><div>Generally this is handy if one window has written content over the top of the top of another (of which it is ''not'' a child), and you wish to bring the content of the covered window back to the fore-front of your display.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="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;"></td><td class='diff-marker'> </td><td style="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;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="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;"><div>You need not call this function when simply making a window [[window.setVisible|visible]] or when [[window.reposition|moving / resizing]] it; <del class="diffchange diffchange-inline">these actions perform automatic redraws</del>.</div></td><td class='diff-marker'>+</td><td style="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;"><div>You need not call this function when simply making a window [[window.setVisible|visible]] or when [[window.reposition|moving / resizing]] it; <ins class="diffchange diffchange-inline">they call it automatically. Redrawing a window also [[window.restoreCursor|restores its cursor]]</ins>.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="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;"><div>|examples=</div></td><td class='diff-marker'> </td><td style="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;"><div>|examples=</div></td></tr>
<tr><td class='diff-marker'> </td><td style="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;"><div>{{Example</div></td><td class='diff-marker'> </td><td style="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;"><div>{{Example</div></td></tr>
<!-- diff cache key ccraft_wiki-mw_:diff:version:1.11a:oldid:6367:newid:6374 -->
</table>Bomb Blokehttp://www.computercraft.info/wiki/index.php?title=Window.redraw&diff=6367&oldid=prevBomb Bloke: Created page with "{{lowercase}} {{Function |name=window.redraw |args= |returns=None |api=term |addon=ComputerCraft |desc=A function available to window-based terminal objects cre..."2014-04-08T10:53:31Z<p>Created page with "{{lowercase}} {{Function |name=window.redraw |args= |returns=None |api=term |addon=ComputerCraft |desc=A function available to window-based <a href="/wiki/Term_(API)" title="Term (API)">terminal objects</a> cre..."</p>
<p><b>New page</b></p><div>{{lowercase}}<br />
{{Function<br />
|name=window.redraw<br />
|args=<br />
|returns=None<br />
|api=term<br />
|addon=ComputerCraft<br />
|desc=A function available to window-based [[term (API)|terminal objects]] created via the [[window (API)|window API]], which re-renders everything that has been rendered via the window in concern (assuming it is [[window.setVisible|visible]]). This includes content rendered via child windows.<br />
<br />
Generally this is handy if one window has written content over the top of the top of another (of which it is ''not'' a child), and you wish to bring the content of the covered window back to the fore-front of your display.<br />
<br />
You need not call this function when simply making a window [[window.setVisible|visible]] or when [[window.reposition|moving / resizing]] it; these actions perform automatic redraws.<br />
|examples=<br />
{{Example<br />
|desc=Draws a checkerboard pattern in a large window, then bounces a smaller window over the top of it, without needing to manually reconstruct the areas rendered over (Ctrl + T to exit):<br />
|code= local xSize, ySize = term.getSize()<br />
<br />
-- Draw a checkerboard pattern in a window that covers the screen:<br />
local checkerWindow = window.create(term.current(), 1, 1, xSize, ySize)<br />
for i=1,ySize do<br />
checkerWindow.setCursorPos(1,i)<br />
for j=1,xSize do<br />
checkerWindow.setBackgroundColor(bit.band(i+j,1) == 1 and colours.white or colours.black)<br />
checkerWindow.write(" ")<br />
end<br />
end<br />
<br />
-- Define a small window at the top left of the display:<br />
local smallWindow = window.create(term.current(), 1, 1, 5, 1)<br />
smallWindow.write("BOING")<br />
<br />
-- Bounce the small window around the screen:<br />
local xDir, yDir, xPos, yPos = 1, 1, 1, 1<br />
<br />
while true do<br />
sleep(0.5)<br />
<br />
xPos = xPos + xDir<br />
yPos = yPos + yDir<br />
<br />
checkerWindow.redraw()<br />
smallWindow.reposition(xPos, yPos)<br />
<br />
if xPos == 1 then xDir = 1 end<br />
if yPos == 1 then yDir = 1 end<br />
if xPos == xSize - 4 then xDir = -1 end<br />
if yPos == ySize then yDir = -1 end<br />
end<br />
}}<br />
}}<br />
<br />
[[Category:API_Functions]]</div>Bomb Bloke