Class Tackboard
- java.lang.Object
-
- jexer.tackboard.Tackboard
-
public class Tackboard extends java.lang.Object
Tackboard maintains a collection of TackboardItems to draw on a Screen.Each item has a set of X, Y, Z pixel (not text cell) coordinates. The coordinate system is right-handed: (0, 0, 0) is the top-left pixel on the screen, and positive Z points away from the user.
When draw() is called, all the items will be rendered in descending Z, ascending Y, ascending X order (painter's algorithm) onto the cell grid, and using transparent pixels. If the Screen's backend does not support imagesOverText, then the text of the Cell under transparent images will be rendered via GlyphMaker, which might not look ideal if the internal font is quite different from the terminal's.
Tackboards were directly inspired by the Visuals (ncvisuals) of notcurses. Jexer's performance is unlikely to come close to notcurses, so users requiring low-latency pixel-based rendering are recommended to check out notcurses.
-
-
Constructor Summary
Constructors Constructor Description Tackboard()
Public constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addItem(TackboardItem item)
Add an item to the board.void
clear()
Remove everything on this board.void
draw(Screen screen, boolean transparent)
Draw everything to the screen.java.util.List<TackboardItem>
getItems()
Get the list of items.void
setDirty()
Set dirty flag.int
size()
Get the number of items on this board.
-
-
-
Method Detail
-
setDirty
public final void setDirty()
Set dirty flag.
-
addItem
public void addItem(TackboardItem item)
Add an item to the board.- Parameters:
item
- the item to add
-
getItems
public java.util.List<TackboardItem> getItems()
Get the list of items.- Returns:
- the list of items
-
size
public int size()
Get the number of items on this board.- Returns:
- the number of items
-
clear
public void clear()
Remove everything on this board.
-
draw
public void draw(Screen screen, boolean transparent)
Draw everything to the screen.- Parameters:
screen
- the screen to render totransparent
- if true, allow partially transparent images to be drawn to the screen
-
-