Bottle 2D - Lua API 1.0.0
All you need to create games using bottle2D.
|
A Sprite is used to render a texture. More...
#include <header.hpp>
Public Member Functions | |
Sprite | Clone () |
Create a clone of the object and return an handler to the clone. | |
Sprite | CloneToGroup (Group newParent) |
Create a clone of the object, change the parent and return an handler to the clone. | |
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 Img) |
Set an image that will be drawn by the sprite. | |
nil | SetColor (Color Col) |
Set object's color. | |
Color | GetColor () |
Get object's color. | |
nil | SetScale (Vector2D Scale) |
Set object's scale. | |
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 | 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. |
A Sprite is used to render a texture.
It can be resised. To create a Shape, you should use Group::CreateShape.
Sprite Sprite::Clone | ( | ) |
Create a clone of the object and return an handler to the clone.
Reimplemented from Object.
Create a clone of the object, change the parent and return an handler to the clone.
Reimplemented from Object.
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 | Img | ) |
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.
Acces object's color.
Change the sprite size.