SFML-2.3.2.2: SFML bindings

Safe HaskellNone
LanguageHaskell98

SFML.Graphics.View

Synopsis

Documentation

createView :: IO View Source

Create a default view.

This function creates a default view of (0, 0, 1000, 1000)

viewFromRect Source

Arguments

:: FloatRect

Rectangle defining the zone to display

-> IO View 

Construct a view from a rectangle

copyView :: View -> IO View Source

Copy an existing view.

destroy :: SFResource a => a -> IO () Source

Destroy the given SFML resource.

setViewCenter :: View -> Vec2f -> IO () Source

Set the center of a view.

setViewSize :: View -> Vec2f -> IO () Source

Set the size of a view.

setViewRotation Source

Arguments

:: View

View object

-> Float

New angle, in degrees

-> IO () 

Set the orientation of a view.

The default rotation of a view is 0 degrees.

setViewport Source

Arguments

:: View

View object

-> FloatRect

New viewport rectangle

-> IO () 

Set the target viewport of a view

The viewport is the rectangle into which the contents of the view are displayed, expressed as a factor (between 0 and 1) of the size of the render target to which the view is applied. For example, a view which takes the left side of the target would be defined by a rect of (0, 0, 0.5, 1).

By default, a view has a viewport which covers the entire target.

resetView Source

Arguments

:: View

View object

-> FloatRect

Rectangle defining the zone to display

-> IO () 

Reset a view to the given rectangle.

Note that this function resets the rotation angle to 0.

getViewCenter :: View -> IO Vec2f Source

Get the center of a view.

getViewSize :: View -> IO Vec2f Source

Get the size of a view.

getViewRotation :: View -> IO Float Source

Get the current orientation of a view, in degrees.

getViewViewport :: View -> IO FloatRect Source

Get the target viewport rectangle of a view, expressed as a factor of the target size.

moveView Source

Arguments

:: View

View object

-> Vec2f

Offset

-> IO () 

Move a view relatively to its current position.

rotateView Source

Arguments

:: View

View object

-> Float

Angle to rotate, in degrees

-> IO () 

Rotate a view relatively to its current orientation.

zoomView Source

Arguments

:: View

View object

-> Float

Zoom factor to apply

-> IO () 

Resize a view rectangle relatively to its current size

Resizing the view simulates a zoom, as the zone displayed on screen grows or shrinks.

factor is a multiplier:

  • 1 keeps the size unchanged
  • > 1 makes the view bigger (objects appear smaller)
  • < 1 makes the view smaller (objects appear bigger)