Copyright | (c) 2018 Francisco Vallarino |
---|---|
License | BSD-3-Clause (see the LICENSE file) |
Maintainer | fjvallarino@gmail.com |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Utility drawing functions. Built on top the lower level primitives provided by Monomer.Graphics.Types.Renderer.
Synopsis
- drawInScissor :: Renderer -> Bool -> Rect -> IO () -> IO ()
- drawInTranslation :: Renderer -> Point -> IO () -> IO ()
- drawInScale :: Renderer -> Point -> IO () -> IO ()
- drawInRotation :: Renderer -> Double -> IO () -> IO ()
- drawInAlpha :: Renderer -> Double -> IO () -> IO ()
- drawTextLine :: Renderer -> StyleState -> TextLine -> IO ()
- drawRect :: Renderer -> Rect -> Maybe Color -> Maybe Radius -> IO ()
- drawRectBorder :: Renderer -> Rect -> Border -> Maybe Radius -> IO ()
- drawArc :: Renderer -> Rect -> Double -> Double -> Winding -> Maybe Color -> IO ()
- drawArcBorder :: Renderer -> Rect -> Double -> Double -> Winding -> Maybe Color -> Double -> IO ()
- drawEllipse :: Renderer -> Rect -> Maybe Color -> IO ()
- drawEllipseBorder :: Renderer -> Rect -> Maybe Color -> Double -> IO ()
- drawArrowDown :: Renderer -> Rect -> Maybe Color -> IO ()
- drawTimesX :: Renderer -> Rect -> Double -> Maybe Color -> IO ()
- drawStyledAction :: Renderer -> Rect -> StyleState -> (Rect -> IO ()) -> IO ()
- drawRoundedRect :: Renderer -> Rect -> Radius -> IO ()
- drawRectRoundedBorder :: Renderer -> Rect -> Border -> Radius -> IO ()
Documentation
:: Renderer | The renderer. |
-> Bool | Whether to apply the scissor (useful to selectively apply). |
-> Rect | Scissor rect, where drawing will be visible. |
-> IO () | Drawing operations. |
-> IO () | The resulting action. |
Performs the provided drawing operations with an active scissor, and then | disables it.
:: Renderer | The renderer. |
-> Point | The offset to apply. |
-> IO () | Drawing operations. |
-> IO () | The resulting action. |
Performs the provided drawing operations displaced by the given offset.
:: Renderer | The renderer. |
-> Point | The horizontal and vertical scale factor to apply. |
-> IO () | Drawing operations. |
-> IO () | The resulting action. |
Performs the provided drawing operations with the given resize scale.
:: Renderer | The renderer. |
-> Double | The angle in degrees. |
-> IO () | Drawing operations. |
-> IO () | The resulting action. |
Performs the provided drawing operations with the given rotation angle.
:: Renderer | The renderer. |
-> Double | The global alpha to apply. |
-> IO () | Drawing operations. |
-> IO () | The resulting action. |
Performs the provided drawing operations with a global alpha applied.
:: Renderer | The renderer. |
-> StyleState | The style to apply. |
-> TextLine | The TextLine with the text to render. |
-> IO () | The resulting action. |
Draws a TextLine with the provided style. Font and size must be the same | as when the TextLine was created, but color and decorations can change.
:: Renderer | The renderer. |
-> Rect | The rectangle to be drawn. |
-> Maybe Color | The color. If Nothing, the rect will not be drawn. |
-> Maybe Radius | The optional radius config. |
-> IO () | The resulting action. |
Draws a filled rect with the given color and radius.
:: Renderer | The renderer. |
-> Rect | The rectangle to be drawn. |
-> Border | The border config. |
-> Maybe Radius | The optional radius config. |
-> IO () | The resulting action. |
Draws a rect's border, with an optional radius.
:: Renderer | The renderer. |
-> Rect | The rect delimiting the arc area. |
-> Double | The start angle in degrees. |
-> Double | The end angle in degrees. |
-> Winding | The direction in which the arc is drawn. |
-> Maybe Color | The color. If Nothing, the arc will not be drawn. |
-> IO () | The resulting action. |
Draws a filled arc, delimited by a rect and within the given angles.
:: Renderer | The renderer. |
-> Rect | The rect delimiting the arc area. |
-> Double | The start angle in degrees. |
-> Double | The end angle in degrees. |
-> Winding | The direction in which the arc is drawn. |
-> Maybe Color | The color. If Nothing, the arc will not be drawn. |
-> Double | The arc width. |
-> IO () | The resulting action. |
Draws an arc's border, delimited by a rect and within the given angles.
:: Renderer | The renderer. |
-> Rect | The rect delimiting the ellipse. |
-> Maybe Color | The color. If Nothing, the ellipse will not be drawn. |
-> IO () | The resulting action. |
Draws a filled ellipse, delimited by a rect.
:: Renderer | The renderer. |
-> Rect | The rect delimiting the ellipse. |
-> Maybe Color | The color. If Nothing, the ellipse will not be drawn. |
-> Double | The border width. |
-> IO () | The resulting action. |
Draws an ellipse's border, delimited by a rect.
:: Renderer | The renderer. |
-> Rect | The rect delimiting the arrow. |
-> Maybe Color | The color. If Nothing, the arrow will not be drawn. |
-> IO () | The resulting action. |
Draws a triangular arrow pointing down, delimited by the given rect.
:: Renderer | The renderer. |
-> Rect | The rect delimiting the arrow. |
-> Double | The width of the lines. |
-> Maybe Color | The color. If Nothing, the X will not be drawn. |
-> IO () | The resulting action. |
Draws an X, delimited by the given rect.
:: Renderer | The renderer. |
-> Rect | The rect where background and border will be drawn. |
-> StyleState | The style defining background and border. |
-> (Rect -> IO ()) | The drawing actions. They receive the content area. |
-> IO () | The resulting action. |
Runs a set of rendering operations after drawing the style's background, and before drawing the style's border.