sdl2-compositor-1.2.0.7: image compositing with sdl2 - declarative style

Safe HaskellNone
LanguageHaskell2010

SDL.Compositor.ResIndependent

Contents

Description

This module provides an implementation for simple resolution independent drawing and rendering. You can do the same stuff with the resolution independent compositor as with a regular one.

One important difference is that the translateA function as well as the standard drawing functions don't work with ResIndependent. Instead there are replacement functions for these operations.

This implementation finds the biggest square that fits into the dimensions of the rendering surface. The top left corner of this sqare is V2 0 0, the bottom right corner is V2 1 1.

Synopsis

Wrapping and unwrapping

fromRelativeCompositor :: (Compositor (c a), AbsoluteSize c) => V2 Int -> ResIndependent c a -> c a #

Convert a resolution independent compositor into a compositor for a fixed screen size by specifying the size of the screen.

Drawing

lineR :: Drawer (c a) => V2 Float -> Color -> ResIndependent c a #

Composition

class RelativeSize c where #

Minimal complete definition

translateR, sizedR

Methods

translateR :: V2 Float -> c a -> c a #

Translate a composition by a given resolution independent vector.

sizedR :: V2 Float -> a -> c a #

This function takes a rectangular area given as resolution independent coordinates and an object and constructs a compositing node from it that spans the given area.