Bubba-3D  0.9.0
Awesome game engine!
Classes | Public Member Functions | Protected Attributes | List of all members
HUDGraphic Class Reference

#include <HUDGraphic.h>

Classes

class  Color
 
struct  TexturePosition
 

Public Member Functions

 HUDGraphic (Texture *texture)
 
 HUDGraphic (Color color)
 
HUDGraphicsetCenterOffset (Dimension offsetX, Dimension offsetY)
 
HUDGraphicsetTexturePosition (TexturePosition< int > texturePosition)
 
TexturePosition< float > getTexturePosition ()
 
chag::float3 getCenterOffset (float width, float height)
 
TexturegetTexture ()
 
chag::float4 getColor ()
 
bool isTextureElseColor ()
 
int * getRoundedCorners ()
 
int * getBorders ()
 
chag::float4 getBorderColor ()
 
HUDGraphicsetRoundedCorners (int pixels)
 
HUDGraphicsetRoundedCorners (int topLeft, int topRight, int botRight, int botLeft)
 
HUDGraphicsetBorder (int pixels, Color borderColor)
 
HUDGraphicsetBorder (int botAndTop, int leftAndRight, Color borderColor)
 
HUDGraphicsetBorder (int top, int right, int bot, int left, Color borderColor)
 
HUDGraphicsetBorderSize (int top, int right, int bot, int left)
 
HUDGraphicsetBorderColor (Color borderColor)
 
HUDGraphicsetBackground (Color color)
 
HUDGraphicsetBackground (Texture *texture)
 

Protected Attributes

Dimension offsetX
 
Dimension offsetY
 
Texturetexture = nullptr
 
chag::float4 color
 
TexturePosition< int > texturePosition
 
bool textureElseColor
 
int roundedCorners [4] = {0, 0, 0, 0}
 
int borders [4] = {0, 0, 0, 0}
 
chag::float4 borderColor
 

Detailed Description

A class used to specify the background graphics of Layout implementations.

Definition at line 29 of file HUDGraphic.h.

Constructor & Destructor Documentation

HUDGraphic::HUDGraphic ( Texture texture)

Creates a graphic that has a texture as a background. If a portion of the texture is required, use HUDGraphic::setTexturePosition()

Definition at line 29 of file HUDGraphic.cpp.

HUDGraphic::HUDGraphic ( Color  color)

Creates a graphic with a solid color as a background.

Definition at line 32 of file HUDGraphic.cpp.

Member Function Documentation

float4 HUDGraphic::getBorderColor ( )

Returns the raw color of the border in RGBA

Definition at line 102 of file HUDGraphic.cpp.

int * HUDGraphic::getBorders ( )

Returns an array of size four. The sizes of the borders are in the following order: top, right, bot, left

Definition at line 106 of file HUDGraphic.cpp.

float4 HUDGraphic::getColor ( )

Returns the color of this graphic, or throws a runtime_error if it only contains a texture.

Definition at line 79 of file HUDGraphic.cpp.

int * HUDGraphic::getRoundedCorners ( )

Returns an array of size four. The sizes of the rounded corners are int he following order: top left, top right, bot right, bot left.

Definition at line 122 of file HUDGraphic.cpp.

Texture * HUDGraphic::getTexture ( )

Returns the texture of this graphic, or throws a runtime_error if it only contains a color.

Definition at line 69 of file HUDGraphic.cpp.

bool HUDGraphic::isTextureElseColor ( )

Returns true if this contains a texture

Definition at line 75 of file HUDGraphic.cpp.

HUDGraphic * HUDGraphic::setCenterOffset ( Dimension  offsetX,
Dimension  offsetY 
)

Set the offset from the actual center that the rotational center should be.

Definition at line 38 of file HUDGraphic.cpp.

HUDGraphic * HUDGraphic::setTexturePosition ( HUDGraphic::TexturePosition< int >  texturePosition)

Sets the portion of the texture that should be used.

Definition at line 44 of file HUDGraphic.cpp.


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