Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- line :: Int -> Int -> Int -> Int -> TwirlMonad ()
- polyLine :: [(Int, Int)] -> TwirlMonad ()
- rectangle :: Int -> Int -> Int -> Int -> FillMode -> TwirlMonad ()
- circle :: Int -> Int -> Double -> Int -> FillMode -> TwirlMonad ()
- drawTexture :: Texture -> Int -> Int -> TwirlMonad ()
- loadTexture :: FilePath -> TwirlMonad Texture
- decodeTexture :: ByteString -> TwirlMonad Texture
- setColor :: Int -> Int -> Int -> Int -> TwirlMonad ()
- setLogicalSize :: Int -> Int -> TwirlMonad ()
- setWindowSize :: Int -> Int -> TwirlMonad ()
- data WindowMode
- setWindowMode :: WindowMode -> TwirlMonad ()
- data Texture
- data Quad
- mkQuad :: Texture -> Int -> Int -> Int -> Int -> Quad
- quadWidth :: Quad -> Int
- quadHeight :: Quad -> Int
- drawQuad :: Quad -> Int -> Int -> Int -> Int -> Bool -> Bool -> TwirlMonad ()
- data TwirlMonad a
- data TwirlContext = TwirlContext {}
- data FillMode
- loadFont :: MonadIO m => FilePath -> PointSize -> m Font
- loadDefaultFont :: MonadIO m => m Font
- type PointSize = Int
- setFont :: Font -> TwirlMonad ()
- printText :: Text -> Int -> Int -> TwirlMonad ()
- runTwirlMonad :: TwirlMonad a -> TwirlContext -> IO (a, TwirlContext)
- setWindowTitle :: Text -> TwirlMonad ()
Documentation
:: Int | X coordinate of one end of the line |
-> Int | Y coordinate of one end of the line |
-> Int | X coordinate of the other end of the line |
-> Int | Y coordinate of the other end of the line |
-> TwirlMonad () |
Draw a line from one point to another
:: Int | X coordinate of the rectangle |
-> Int | Y coordinate of the rectangle |
-> Int | Width of the rectangle |
-> Int | Height of the rectangle |
-> FillMode | |
-> TwirlMonad () |
Draw an axis aligned rectangle
:: Int | X coordinate of the top-left "corner" of the circle |
-> Int | Y coordinate of the top-left "corner" of the circle |
-> Double | Radius of the circle |
-> Int | How many segments the circle should be made of |
-> FillMode | Whether to draw the circle hollow or filled |
-> TwirlMonad () |
Draw a circle
The drawn shape is not actually a circle, but rather a polygon consisting of a number of segments. Larger value results in a smoother circle, but is slower to draw.
:: Texture | The texture to draw |
-> Int | X coordinate of the texture's top-left corner |
-> Int | Y coordinate of the texture's top-left corner |
-> TwirlMonad () |
Draw a texture
The texture position is specified as its top-left corner's position
loadTexture :: FilePath -> TwirlMonad Texture Source #
:: Int | Red channel value in the interval |
-> Int | Green channel value in the interval |
-> Int | Blue channel value in the interval |
-> Int | Alpha value in the interval |
-> TwirlMonad () |
Set the drawing colour for the next TwirlMonad
s
setLogicalSize :: Int -> Int -> TwirlMonad () Source #
setWindowSize :: Int -> Int -> TwirlMonad () Source #
data WindowMode #
Fullscreen | Real fullscreen with a video mode change |
FullscreenDesktop | Fake fullscreen that takes the size of the desktop |
Maximized | |
Minimized | |
Windowed |
Instances
setWindowMode :: WindowMode -> TwirlMonad () Source #
quadHeight :: Quad -> Int Source #
data TwirlMonad a Source #
Instances
MonadIO TwirlMonad Source # | |
Defined in Twirl.Graphics liftIO :: IO a -> TwirlMonad a # | |
Applicative TwirlMonad Source # | |
Defined in Twirl.Graphics pure :: a -> TwirlMonad a # (<*>) :: TwirlMonad (a -> b) -> TwirlMonad a -> TwirlMonad b # liftA2 :: (a -> b -> c) -> TwirlMonad a -> TwirlMonad b -> TwirlMonad c # (*>) :: TwirlMonad a -> TwirlMonad b -> TwirlMonad b # (<*) :: TwirlMonad a -> TwirlMonad b -> TwirlMonad a # | |
Functor TwirlMonad Source # | |
Defined in Twirl.Graphics fmap :: (a -> b) -> TwirlMonad a -> TwirlMonad b # (<$) :: a -> TwirlMonad b -> TwirlMonad a # | |
Monad TwirlMonad Source # | |
Defined in Twirl.Graphics (>>=) :: TwirlMonad a -> (a -> TwirlMonad b) -> TwirlMonad b # (>>) :: TwirlMonad a -> TwirlMonad b -> TwirlMonad b # return :: a -> TwirlMonad a # | |
MonadState TwirlContext TwirlMonad Source # | |
Defined in Twirl.Graphics get :: TwirlMonad TwirlContext # put :: TwirlContext -> TwirlMonad () # state :: (TwirlContext -> (a, TwirlContext)) -> TwirlMonad a # |
data TwirlContext Source #
Instances
MonadState TwirlContext TwirlMonad Source # | |
Defined in Twirl.Graphics get :: TwirlMonad TwirlContext # put :: TwirlContext -> TwirlMonad () # state :: (TwirlContext -> (a, TwirlContext)) -> TwirlMonad a # |
loadDefaultFont :: MonadIO m => m Font Source #
setFont :: Font -> TwirlMonad () Source #
runTwirlMonad :: TwirlMonad a -> TwirlContext -> IO (a, TwirlContext) Source #
setWindowTitle :: Text -> TwirlMonad () Source #