twirl-0.4.0.4: Simple 2D Game Engine
Safe HaskellSafe-Inferred
LanguageHaskell2010

Twirl.Graphics

Synopsis

Documentation

line Source #

Arguments

:: 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

rectangle Source #

Arguments

:: 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

circle Source #

Arguments

:: 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.

drawTexture Source #

Arguments

:: 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

setColor Source #

Arguments

:: Int

Red channel value in the interval [0,255]

-> Int

Green channel value in the interval [0,255]

-> Int

Blue channel value in the interval [0,255]

-> Int

Alpha value in the interval [0,255]

-> TwirlMonad () 

Set the drawing colour for the next TwirlMonads

data WindowMode #

Constructors

Fullscreen

Real fullscreen with a video mode change

FullscreenDesktop

Fake fullscreen that takes the size of the desktop

Maximized 
Minimized 
Windowed 

Instances

Instances details
Data WindowMode 
Instance details

Defined in SDL.Video

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> WindowMode -> c WindowMode #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c WindowMode #

toConstr :: WindowMode -> Constr #

dataTypeOf :: WindowMode -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c WindowMode) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c WindowMode) #

gmapT :: (forall b. Data b => b -> b) -> WindowMode -> WindowMode #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> WindowMode -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> WindowMode -> r #

gmapQ :: (forall d. Data d => d -> u) -> WindowMode -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> WindowMode -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> WindowMode -> m WindowMode #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> WindowMode -> m WindowMode #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> WindowMode -> m WindowMode #

Bounded WindowMode 
Instance details

Defined in SDL.Video

Enum WindowMode 
Instance details

Defined in SDL.Video

Generic WindowMode 
Instance details

Defined in SDL.Video

Associated Types

type Rep WindowMode :: Type -> Type #

Read WindowMode 
Instance details

Defined in SDL.Video

Show WindowMode 
Instance details

Defined in SDL.Video

Eq WindowMode 
Instance details

Defined in SDL.Video

Ord WindowMode 
Instance details

Defined in SDL.Video

FromNumber WindowMode Word32 
Instance details

Defined in SDL.Video

ToNumber WindowMode Word32 
Instance details

Defined in SDL.Video

type Rep WindowMode 
Instance details

Defined in SDL.Video

type Rep WindowMode = D1 ('MetaData "WindowMode" "SDL.Video" "sdl2-2.5.3.2-FEL7WnoiYrz20iRHYD18CW" 'False) ((C1 ('MetaCons "Fullscreen" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "FullscreenDesktop" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Maximized" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Minimized" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Windowed" 'PrefixI 'False) (U1 :: Type -> Type))))

data Texture #

Instances

Instances details
Eq Texture 
Instance details

Defined in SDL.Video.Renderer

Methods

(==) :: Texture -> Texture -> Bool #

(/=) :: Texture -> Texture -> Bool #

data Quad Source #

Instances

Instances details
Eq Quad Source # 
Instance details

Defined in Twirl.Graphics

Methods

(==) :: Quad -> Quad -> Bool #

(/=) :: Quad -> Quad -> Bool #

mkQuad :: Texture -> Int -> Int -> Int -> Int -> Quad Source #

drawQuad :: Quad -> Int -> Int -> Int -> Int -> Bool -> Bool -> TwirlMonad () Source #

data TwirlMonad a Source #

Instances

Instances details
MonadIO TwirlMonad Source # 
Instance details

Defined in Twirl.Graphics

Methods

liftIO :: IO a -> TwirlMonad a #

Applicative TwirlMonad Source # 
Instance details

Defined in Twirl.Graphics

Methods

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 # 
Instance details

Defined in Twirl.Graphics

Methods

fmap :: (a -> b) -> TwirlMonad a -> TwirlMonad b #

(<$) :: a -> TwirlMonad b -> TwirlMonad a #

Monad TwirlMonad Source # 
Instance details

Defined in Twirl.Graphics

Methods

(>>=) :: TwirlMonad a -> (a -> TwirlMonad b) -> TwirlMonad b #

(>>) :: TwirlMonad a -> TwirlMonad b -> TwirlMonad b #

return :: a -> TwirlMonad a #

MonadState TwirlContext TwirlMonad Source # 
Instance details

Defined in Twirl.Graphics

data TwirlContext Source #

Constructors

TwirlContext 

Fields

Instances

Instances details
MonadState TwirlContext TwirlMonad Source # 
Instance details

Defined in Twirl.Graphics

data FillMode Source #

Constructors

Fill 
Hollow 

type PointSize = Int #

Point size (based on 72DPI) to load font as. Translates to pixel height.