Rocket::Core::TextureLayoutRectangle Class Reference

#include <TextureLayoutRectangle.h>

Collaboration diagram for Rocket::Core::TextureLayoutRectangle:

Public Member Functions

 TextureLayoutRectangle (int id, const Vector2i &dimensions)
int GetId () const
const Vector2iGetPosition () const
const Vector2iGetDimensions () const
void Place (int texture_index, const Vector2i &position)
void Unplace ()
 Unplaces the rectangle.
bool IsPlaced () const
void Allocate (byte *texture_data, int texture_stride)
int GetTextureIndex ()
byte * GetTextureData ()
int GetTextureStride () const

Detailed Description

A texture layout rectangle is an area positioned with a texture layout.

Author:
Peter

Member Function Documentation

int Rocket::Core::TextureLayoutRectangle::GetId (  )  const

Returns the rectangle's id.

Returns:
The rectangle's id.

const Vector2i & Rocket::Core::TextureLayoutRectangle::GetPosition (  )  const

Returns the rectangle's position; this is only valid if it has been placed.

Returns:
The rectangle's position within its texture.

const Vector2i & Rocket::Core::TextureLayoutRectangle::GetDimensions (  )  const

Returns the rectangle's dimensions.

Returns:
The rectangle's dimensions.

void Rocket::Core::TextureLayoutRectangle::Place ( int  texture_index,
const Vector2i position 
)

Places the rectangle within a texture.

Parameters:
[in] texture_index The index of the texture this rectangle is placed on.
[in] position The position within the texture of this rectangle's top-left corner.

bool Rocket::Core::TextureLayoutRectangle::IsPlaced (  )  const

Returns the rectangle's placed state.

Returns:
True if the rectangle has been placed, false if not.

void Rocket::Core::TextureLayoutRectangle::Allocate ( byte *  texture_data,
int  texture_stride 
)

Sets the rectangle's texture data and stride.

Parameters:
[in] texture_data The pointer to the top-left corner of the texture's data.
[in] texture_stride The stride of the texture data, in bytes.

int Rocket::Core::TextureLayoutRectangle::GetTextureIndex (  ) 

Returns the index of the texture this rectangle is placed on.

Returns:
The texture index.

byte * Rocket::Core::TextureLayoutRectangle::GetTextureData (  ) 

Returns the rectangle's allocated texture data.

Returns:
The texture data.

int Rocket::Core::TextureLayoutRectangle::GetTextureStride (  )  const

Returns the stride of the rectangle's texture data.

Returns:
The texture data stride.


The documentation for this class was generated from the following files: