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

Sprite Class Reference

A Sprite is used to render a texture. More...

#include <header.hpp>

Inheritance diagram for Sprite:
Drawable Object TexturedArea

List of all members.

Public Member Functions

Vector2D GetSize ()
 Get the current size of the displayed sprite.
nil SetSize (Vector2D newSize)
 Set the current size of the displayed sprite.
nil SetImage (Texture image)
 Set an image that will be drawn by the sprite.
nil SetColor (Color Col)
 Set object's color.
Color GetColor ()
 Get object's color.
Vector2D GetScale ()
 Get object's scale.
nil SetScaleX (number FactorX)
 Set object's scale (x)
nil SetScaleY (number FactorY)
 Set object's scale (y)
nil SetScale (Vector2D scale)
 Set object's scale.
nil SetCenter (Vector2D center)
 Set object's center.
Vector2D GetCenter ()
 Get object's center.
nil FlipX (bool Flipped)
 Set if the image should be flipped (X axis)
nil FlipY (bool Flipped)
 Set if the image should be flipped (Y axis)
Color GetPixel (unsigned number X, unsigned number Y)
 Get the color of a pixel in the image.

Public Attributes

Vector2D size
 Change the sprite size.
Color color
 Acces object's color.

Detailed Description

A Sprite is used to render a texture.

It can be resised. To create a Shape, you should use Group::CreateShape.


Member Function Documentation

nil Sprite::FlipX ( bool  Flipped)

Set if the image should be flipped (X axis)

nil Sprite::FlipY ( bool  Flipped)

Set if the image should be flipped (Y axis)

Vector2D Sprite::GetCenter ( )

Get object's center.

Color Sprite::GetColor ( )

Get object's color.

Color Sprite::GetPixel ( unsigned number  X,
unsigned number  Y 
)

Get the color of a pixel in the image.

Vector2D Sprite::GetScale ( )

Get object's scale.

Vector2D Sprite::GetSize ( )

Get the current size of the displayed sprite.

nil Sprite::SetCenter ( Vector2D  center)

Set object's center.

nil Sprite::SetColor ( Color  Col)

Set object's color.

nil Sprite::SetImage ( Texture  image)

Set an image that will be drawn by the sprite.

nil Sprite::SetScale ( Vector2D  scale)

Set object's scale.

nil Sprite::SetScaleX ( number  FactorX)

Set object's scale (x)

nil Sprite::SetScaleY ( number  FactorY)

Set object's scale (y)

nil Sprite::SetSize ( Vector2D  newSize)

Set the current size of the displayed sprite.


Member Data Documentation

Acces object's color.

Change the sprite size.

Reimplemented in TexturedArea.


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