Layout Borders
Layout Borders
Section titled “Layout Borders”box() and rule() draw with a border style. The game’s default is the layout_border option, double unless the game changes it; "border":"<style>" picks another. A client without Unicode is sent double as the mush style shown below.
- layout border styles: mush, ascii, single, double, heavy, rounded and none
- layout borders nested: a border given to a layout that holds others
- layout border pieces: corners, edges, tees and title brackets of your own
- layout borders ascii: what a client without Unicode is sent
Styles
Section titled “Styles”+=====< Title >====+ +-----< Title >----+| mush | | ascii |+==================+ +------------------+mush and ascii are plain ASCII. The other styles are drawn with Unicode box-drawing lines:
double- double linessingle- light linesheavy- thick linesrounded- light lines with rounded corners
Each sets its title between small tee brackets in the top edge. A client without Unicode is sent them in ASCII, as described under ASCII clients below. The examples in these topics show the ASCII form.
"border":"none" draws no frame, only the title and the padded body.
Borders inside other layouts
Section titled “Borders inside other layouts”The border options are not only for box() and rule(). Given to any layout that holds others, such as box(), flex(), fields(), tree(), bullets(), grid() or datatable(), they set the border of every box and rule inside it that names none, the way layout_border does for the whole game. A box or rule that names its own keeps it.
> think flex({{"border":"ascii"}},box(Left,,12),box(Right,,12,{{"border":"double"}}))+----------+ +==========+| Left | | Right |+----------+ +==========+Border pieces
Section titled “Border pieces”Any part of the style can be replaced, after "border" picks the starting point:
corner(all four), ortl,tr,bl,brone at a timetop,bottom;side(both), orleft,rightteel,teer- where a divider meets the left and right sidesteet,teeb,cross- where a line between joined panes meets the top edge, the bottom edge, and a divider; see [flex() panes]open,close- the brackets round a title
An edge is a pattern repeated along it, so "top":"=-" alternates and "top":"[ansi(hb,=)]" is blue.
> think box(Two fields,,30,{{"side":" ","corner":" ","top":"~","bottom":"~"}}) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Two fields ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ASCII clients
Section titled “ASCII clients”A telnet client that did not agree to UTF-8 is sent each box-drawing character as the nearest ASCII one:
- a light line as
- - a double or heavy line as
= - an upright as
| - a corner or tee as
+
A double box stays recognisably double, and colour is kept. A piece that is not box drawing at all, such as an emoji or the tee bracket round a title in the Unicode styles, becomes the ascii style’s piece instead. Tree guides become |- and `-. A "sep" between flex items is translated the same way. The text inside a layout is sent as CHARSET describes, before the layout is lined up. The portal ignores border characters and draws borders itself.
::: seealso