Bottle 2D - Lua API 1.0.0
All you need to create games using bottle2D.
Public Member Functions | Public Attributes

ScreenConfig Class Reference

A ScreenConfig is associated to a screen. More...

#include <header.hpp>

List of all members.

Public Member Functions

 ScreenConfig ()
 Create a basic config with a 1024*768 size, and set according ratio.
 ScreenConfig (Vector2D size)
 Create a basic config with user size, and set according ratio.
nil ChangeSize (Vector2D size)
 Set the screen size and the according ratio.
nil CameraReset ()
 Reset the camera to show the entire screen.
nil SetForcedRatio (number value)
 Set the ratio.
number GetForcedRatio ()
 Get the ratio.
nil SetFixedRatio (bool value)
 Choose if the engine should always use the same ratio on resize (add strips to the screen in order to keep the same ratio)
bool IsFixedRatio ()
 Tells if the engine should always use the same ratio on resize.
nil SetScreenSize (Vector2D value)
 Set the screen size but doesn't change the ratio.
Vector2D GetScreenSize ()
 Get the screen size.
nil SetCameraTopLeft (Vector2D value)
 Set the camera top left position.
Vector2D GetCameraTopLeft ()
 Get the camera top left position.
nil SetCameraBottomRight (Vector2D value)
 Set the camera bottom right position.
Vector2D GetCameraBottomRight ()
 Get the camera bottom right position.
nil CameraMove (Vector2D mvt)
 Move the camera with the given offset.
nil CameraZoom (number addedZoom)
 Zoom.
nil CameraZoom (Vector2D addedZoom)
 Zoom.
nil CameraSetZoom (number zoom)
 Access the camera zoom.
nil CameraSetZoom (Vector2D zoom)
 Set zoom, using screen size as a reference.
nil CameraSetCenter (Vector2D center)
 Set the camera center.
Vector2D CameraGetCenter ()
 Get the camera center.
nil CameraSetHalfSize (Vector2D halfSize)
 Set the camera half size.
Vector2D CameraGetHalfSize ()
 Get the camera half size.

Public Attributes

float forcedRatio
 Access the ratio.
bool isFixedRatio
 Choose if the engine should always use the same ratio on resize (add strips to the screen in order to keep the same ratio)
Vector2D screenSize
 Set / Get the screen size but doesn't change the ratio.
Vector2D cameraTopLeft
 Set the camera top left position.
Vector2D cameraBottomRight
 Set the camera bottom right position.
Vector2D cameraCenter
 Get zoom, using screen size.
Vector2D cameraHalfSize
 Access the camera half size.

Detailed Description

A ScreenConfig is associated to a screen.

It alows you to chose the screen virtual size and its ratio.


Constructor & Destructor Documentation

ScreenConfig::ScreenConfig ( )

Create a basic config with a 1024*768 size, and set according ratio.

ScreenConfig::ScreenConfig ( Vector2D  size)

Create a basic config with user size, and set according ratio.


Member Function Documentation

Vector2D ScreenConfig::CameraGetCenter ( )

Get the camera center.

Vector2D ScreenConfig::CameraGetHalfSize ( )

Get the camera half size.

nil ScreenConfig::CameraMove ( Vector2D  mvt)

Move the camera with the given offset.

nil ScreenConfig::CameraReset ( )

Reset the camera to show the entire screen.

nil ScreenConfig::CameraSetCenter ( Vector2D  center)

Set the camera center.

nil ScreenConfig::CameraSetHalfSize ( Vector2D  halfSize)

Set the camera half size.

nil ScreenConfig::CameraSetZoom ( number  zoom)

Access the camera zoom.

Set zoom, using screen size as a reference

nil ScreenConfig::CameraSetZoom ( Vector2D  zoom)

Set zoom, using screen size as a reference.

nil ScreenConfig::CameraZoom ( number  addedZoom)

Zoom.

nil ScreenConfig::CameraZoom ( Vector2D  addedZoom)

Zoom.

nil ScreenConfig::ChangeSize ( Vector2D  size)

Set the screen size and the according ratio.

Reset the camera

Vector2D ScreenConfig::GetCameraBottomRight ( )

Get the camera bottom right position.

Vector2D ScreenConfig::GetCameraTopLeft ( )

Get the camera top left position.

number ScreenConfig::GetForcedRatio ( )

Get the ratio.

Vector2D ScreenConfig::GetScreenSize ( )

Get the screen size.

bool ScreenConfig::IsFixedRatio ( )

Tells if the engine should always use the same ratio on resize.

nil ScreenConfig::SetCameraBottomRight ( Vector2D  value)

Set the camera bottom right position.

nil ScreenConfig::SetCameraTopLeft ( Vector2D  value)

Set the camera top left position.

nil ScreenConfig::SetFixedRatio ( bool  value)

Choose if the engine should always use the same ratio on resize (add strips to the screen in order to keep the same ratio)

nil ScreenConfig::SetForcedRatio ( number  value)

Set the ratio.

nil ScreenConfig::SetScreenSize ( Vector2D  value)

Set the screen size but doesn't change the ratio.


Member Data Documentation

Set the camera bottom right position.

Get zoom, using screen size.

Access the camera half size

Access the camera half size.

Set the camera top left position.

Access the ratio.

Choose if the engine should always use the same ratio on resize (add strips to the screen in order to keep the same ratio)

Set / Get the screen size but doesn't change the ratio.


The documentation for this class was generated from the following file:
 All Classes Files Functions Variables