<box>
Defines a rectangular container on the screen, which can contain any kind of visual content in its default field. Boxes are created inline with the flow of text in the console by default, but can be taken out of the flow using the inline field. Boxes can be automatically sized or have fixed size and position. They can have scrollable contents, or the contents can be clipped to the size of the box.
For content-heavy boxes, rendering performance can often be enhanced by using the visible field to hide the box while it is being filled with content, then displaying the box once its contents are complete.
Fields
The default field specifies text content, including markup tags and special elements, to be contained inside the box.
Additionally, the following named fields can be defined on this tag. Please refer to the field reference section of this site for details on each field.
- background-color
- bold
- border
- border-bottom
- border-color
- border-left
- border-right
- border-top
- bottom
- color
- height
- inline
- italic
- layer
- left
- margin
- margin-bottom
- margin-left
- margin-right
- margin-top
- mouse
- onclick
- oncontextclick
- onexit
- onmousedown
- onmousein
- onmousemove
- onmouseout
- onmouseup
- right
- rotate
- size
- spacing
- spacing-bottom
- spacing-left
- spacing-right
- spacing-top
- text-align
- top
- underline
- vertical-align
- visible
- width
Example
This example places two boxes on the screen. Although both boxes are placed in a single line of text, there are two lines inside each box. The second box is upside-down due to defining the rotate field.
The output is shown below.
<box {This text is printed</n>normally on 2 lines}> ...but... <box rotate=180,{deg} {This text is</n>upside down!}>
normally on 2 lines
upside down!