Safe Haskell | None |
---|---|
Language | Haskell2010 |
- type Width = Int
- type Height = Int
- class Renderable r where
- data RenderInfo = RenderInfo YiString Styles
- type ScrollPos = Int
- cropToViewport :: Height -> ScrollPos -> RenderInfo -> RenderInfo
- styleText :: YiString -> Style -> RenderInfo
Documentation
class Renderable r where Source #
Represents how to render an entity
data RenderInfo Source #
RenderInfo is the data necessary to render something; it consists of a block of
text with its associated styles. It is a Monoid and can be appended with other RenderInfo
s.
Monoid RenderInfo Source # | Appends to RenderInfo by appending the text and styles while preserving proper text/style alignment |
Renderable RenderInfo Source # | |
cropToViewport :: Height -> ScrollPos -> RenderInfo -> RenderInfo Source #
Crop text verticaly to only the visible portion according to viewport height and scroll position.
styleText :: YiString -> Style -> RenderInfo Source #
Add a style to some text resulting in a RenderInfo