import{_ as r,a as t,b as a,ag as d}from"./chunks/framework.BcrMLAmg.js";const b=JSON.parse('{"title":"Render","description":"","frontmatter":{},"headers":[],"relativePath":"references/render.md","filePath":"references/render.md","lastUpdated":1757840145000}'),o={name:"references/render.md"};function i(n,e,l,h,c,s){return a(),t("div",null,e[0]||(e[0]=[d('
_This is the render module for Basalt. It tries to mimic the functionality of the term API. but with additional _ functionality. It also has a buffer system to reduce the number of calls
| Method | Returns | Description |
|---|---|---|
| Render.new | Render | Creates a new Render object |
| Render:addDirtyRect | Render | Adds a dirty rectangle to the buffer |
| Render:blit | Render | Blits text to the screen |
| Render:multiBlit | Render | Blits text to the screen with multiple lines |
| Render:textFg | Render | Blits text to the screen with a foreground color |
| Render:textBg | Render | Blits text to the screen with a background color |
| Render:text | Render | Renders the text to the screen |
| Render:fg | Render | Blits a foreground color to the screen |
| Render:bg | Render | Blits a background color to the screen |
| Render:text | Render | Blits text to the screen |
| Render:fg | Render | Blits a foreground color to the screen |
| Render:bg | Render | Blits a background color to the screen |
| Render:clear | Render | Clears the screen |
| Render:render | Render | Renders the buffer to the screen |
| Render:rectOverlaps | boolean | Checks if two rectangles overlap |
| Render:mergeRects | Render | Merges two rectangles |
| Render:setCursor | Render | Sets the cursor position |
| Render:clearArea | Render | Clears an area of the screen |
| Render:getSize | number | Gets the size of the render |
| Render:setSize | Render | Sets the size of the render |
Creates a new Render object
terminal table The terminal object to render toRenderAdds a dirty rectangle to the buffer
x number The x position of the rectangley number The y position of the rectanglewidth number The width of the rectangleheight number The height of the rectangleRenderBlits text to the screen
x number The x position to blit toy number The y position to blit totext string The text to blitfg string The foreground color of the textbg string The background color of the textRenderBlits text to the screen with multiple lines
x number The x position to blit toy number The y position to blit towidth number The width of the textheight number The height of the texttext string The text to blitfg colors The foreground color of the textbg colors The background color of the textRenderBlits text to the screen with a foreground color
x number The x position to blit toy number The y position to blit totext string The text to blitfg colors The foreground color of the textRenderBlits text to the screen with a background color
x number The x position to blit toy number The y position to blit totext string The text to blitbg colors The background color of the textRenderRenders the text to the screen
x number The x position to blit toy number The y position to blit totext string The text to blitRenderBlits a foreground color to the screen
x number The x positiony number The y positionfg string The foreground color to blitRenderBlits a background color to the screen
x number The x positiony number The y positionbg string The background color to blitRenderBlits text to the screen
x number The x position to blit toy number The y position to blit totext string The text to blitRenderBlits a foreground color to the screen
x number The x positiony number The y positionfg string The foreground color to blitRenderBlits a background color to the screen
x number The x positiony number The y positionbg string The background color to blitRenderClears the screen
bg colors The background color to clear the screen withRenderRenders the buffer to the screen
RenderChecks if two rectangles overlap
r1 table The first rectangler2 table The second rectanglebooleanMerges two rectangles
target table The target rectanglesource table The source rectangleRenderSets the cursor position
x number The x position of the cursory number The y position of the cursorblink boolean Whether the cursor should blinkRenderClears an area of the screen
x number The x position of the areay number The y position of the areawidth number The width of the areaheight number The height of the areabg colors The background color to clear the area withRenderGets the size of the render
numberSets the size of the render
width number The width of the renderheight number The height of the renderRender