Gamedev Framework (gf)  0.3.0
A C++11 framework for 2D games
Public Member Functions | Protected Member Functions | List of all members
gf::FillView Class Reference

Fill view. More...

#include <gf/Views.h>

Inheritance diagram for gf::FillView:
Inheritance graph
[legend]

Public Member Functions

 FillView ()
 Default constructor. More...
 
 FillView (const RectF &rect)
 Construct the view from a rectangle. More...
 
 FillView (Vector2f center, Vector2f size)
 Construct the view from its center and size. More...
 
virtual void onScreenResize (Vector2u screenSize) override
 Callback when the screen has just been resized. More...
 
- Public Member Functions inherited from gf::AdaptativeView
 AdaptativeView ()
 Default constructor. More...
 
 AdaptativeView (const RectF &rect)
 Construct the view from a rectangle. More...
 
 AdaptativeView (Vector2f center, Vector2f size)
 Construct the view from its center and size. More...
 
void setInitialScreenSize (Vector2u screenSize)
 Set the initial screen size. More...
 
- Public Member Functions inherited from gf::View
 View ()
 Default constructor. More...
 
 View (const RectF &rect)
 Construct the view from a rectangle. More...
 
 View (Vector2f center, Vector2f size)
 Construct the view from its center and size. More...
 
virtual ~View ()
 Destructor. More...
 
void setCenter (Vector2f center)
 Set the center of the view. More...
 
Vector2f getCenter () const
 Get the center of the view. More...
 
void setSize (Vector2f size)
 Set the size of the view. More...
 
Vector2f getSize () const
 Get the size of the view. More...
 
void setRotation (float rotation)
 Set the orientation of the view. More...
 
float getRotation () const
 Get the current orientation of the view. More...
 
void setViewport (const RectF &viewport)
 Set the target viewport. More...
 
const RectFgetViewport () const
 Get the target viewport rectangle of the view. More...
 
void reset (const RectF &rect)
 Reset the view to the given rectangle. More...
 
void move (Vector2f offset)
 Move the view relatively to its current position. More...
 
void rotate (float angle)
 Rotate the view relatively to its current orientation. More...
 
void zoom (float factor)
 Resize the view rectangle relatively to its current size. More...
 
Matrix3f getTransform () const
 Get the projection transform of the view. More...
 
Matrix3f getInverseTransform () const
 Get the inverse projection transform of the view. More...
 

Protected Member Functions

virtual void onWorldResize (Vector2f worldSize) override
 Callback when the world has just been resized. More...
 
- Protected Member Functions inherited from gf::View
void setWorldSize (Vector2f size)
 Set the world size, without calling onWorldResize() More...
 

Detailed Description

Fill view.

This view keeps the aspect ratio of the world, but it will always fill the whole screen which might result in parts of the world being cut off.

fillview.png
Fill view
See also
gf::AdaptativeView

Constructor & Destructor Documentation

gf::FillView::FillView ( )
inline

Default constructor.

This constructor creates a default view of \((0, 0, 1000, 1000)\).

gf::FillView::FillView ( const RectF rect)
inlineexplicit

Construct the view from a rectangle.

Parameters
rectRectangle defining the zone to display
gf::FillView::FillView ( Vector2f  center,
Vector2f  size 
)
inline

Construct the view from its center and size.

Parameters
centerCenter of the zone to display
sizeSize of the zone to display

Member Function Documentation

virtual void gf::FillView::onScreenResize ( Vector2u  screenSize)
overridevirtual

Callback when the screen has just been resized.

Parameters
screenSizeThe new size of the screen

Implements gf::AdaptativeView.

virtual void gf::FillView::onWorldResize ( Vector2f  worldSize)
overrideprotectedvirtual

Callback when the world has just been resized.

This callback is called when setSize() is called.

Parameters
worldSizeThe new size of the visible world

Reimplemented from gf::View.