Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module provides many convenient operations for textures.
Synopsis
- centerL :: Lens' (Rectangle a) (V2 a)
- sizeL :: Lens' (Rectangle a) (V2 a)
- data Figure = Figure {
- texture :: Texture
- sourceArea :: Rectangle Int
- targetArea :: Rectangle Int
- rotation :: Double
- getFigureSize :: Figure -> V2 Int
- freeFigure :: MonadIO m => Figure -> m ()
- union :: Rectangle Int -> Rectangle Int -> Rectangle Int
- render :: (HasLightEnv env, MonadIO m, MonadMask m) => Figure -> LightT env m ()
- renders :: (HasLightEnv env, MonadIO m, MonadMask m) => [Figure] -> LightT env m ()
- withBlendedText :: (MonadIO m, MonadMask m) => Font -> Text -> Color -> (Surface -> m a) -> m a
- class Rendering r m | r -> m where
- translate :: V2 Int -> r -> r
- clip :: Rectangle Int -> r -> r
- rotate :: Double -> r -> r
- text :: Font -> V4 Word8 -> Text -> m r
- picture :: FilePath -> m r
- fromTexture :: Texture -> m r
- rectangleOutline :: V4 Word8 -> V2 Int -> m r
- rectangleFilled :: V4 Word8 -> V2 Int -> m r
- triangleOutline :: V4 Word8 -> V2 Int -> m r
Documentation
Figure type carries a texture, sizing information and rotation information.
Figure | |
|
Instances
Rendering Figure MiniLight Source # | |
Defined in MiniLight.Figure translate :: V2 Int -> Figure -> Figure Source # clip :: Rectangle Int -> Figure -> Figure Source # rotate :: Double -> Figure -> Figure Source # text :: Font -> V4 Word8 -> Text -> MiniLight Figure Source # picture :: FilePath -> MiniLight Figure Source # fromTexture :: Texture -> MiniLight Figure Source # rectangleOutline :: V4 Word8 -> V2 Int -> MiniLight Figure Source # rectangleFilled :: V4 Word8 -> V2 Int -> MiniLight Figure Source # triangleOutline :: V4 Word8 -> V2 Int -> MiniLight Figure Source # |
getFigureSize :: Figure -> V2 Int Source #
freeFigure :: MonadIO m => Figure -> m () Source #
render :: (HasLightEnv env, MonadIO m, MonadMask m) => Figure -> LightT env m () Source #
Render a figure.
renders :: (HasLightEnv env, MonadIO m, MonadMask m) => [Figure] -> LightT env m () Source #
Render figures.
withBlendedText :: (MonadIO m, MonadMask m) => Font -> Text -> Color -> (Surface -> m a) -> m a Source #
class Rendering r m | r -> m where Source #
Rendering typeclass provides basic operations for figures.
translate :: V2 Int -> r -> r Source #
Change the place to be rendered.
clip :: Rectangle Int -> r -> r Source #
Specify some area and clip the figure into the region.
rotate :: Double -> r -> r Source #
Rotate a figure.
text :: Font -> V4 Word8 -> Text -> m r Source #
Create a text texture. Be careful: this is a slow operation, use cache as long as you can.
picture :: FilePath -> m r Source #
Create a texture from a png file. Be careful: this is a slow operation, use cache as long as you can.
fromTexture :: Texture -> m r Source #
Create a texture from a raw SDL texture.
Create an outlined rectangle. Be careful: this is a slow operation, use cache as long as you can.
Create a filled texture. Be careful: this is a slow operation, use cache as long as you can.
Create an outlined triangle. Be careful: this is a slow operation, use cache as long as you can.
Instances
Rendering Figure MiniLight Source # | |
Defined in MiniLight.Figure translate :: V2 Int -> Figure -> Figure Source # clip :: Rectangle Int -> Figure -> Figure Source # rotate :: Double -> Figure -> Figure Source # text :: Font -> V4 Word8 -> Text -> MiniLight Figure Source # picture :: FilePath -> MiniLight Figure Source # fromTexture :: Texture -> MiniLight Figure Source # rectangleOutline :: V4 Word8 -> V2 Int -> MiniLight Figure Source # rectangleFilled :: V4 Word8 -> V2 Int -> MiniLight Figure Source # triangleOutline :: V4 Word8 -> V2 Int -> MiniLight Figure Source # |