U4DEngine::U4DMultiImage class

The U4DMultiImage class represents multi-images entities such as buttons with a pressed and a released image.

Base classes

class U4DEngine::U4DImage
The U4DImage class represents all images in a game.

Constructors, destructors, conversion operators

U4DMultiImage()
Constructor of class.
~U4DMultiImage()
Destructor of class.
U4DMultiImage(const char* uTextureOne, const char* uTextureTwo, float uWidth, float uHeight)
Constructor of class.

Public functions

void render(id<MTLRenderCommandEncoder> uRenderEncoder) virtual
Renders the current entity.
void setImage(const char* uTextureOne, const char* uTextureTwo, float uWidth, float uHeight)
sets the image textures
auto getImageState() -> bool virtual
current state of the image. Used for multi-image entities such as buttons to change between the main and secondary texture
void setImageState(bool uValue) virtual
sets the state of the image. Used for multi-image entities such as buttons to change between the main and secondary texture
void changeImage()
change the current rendered texture. It alternates between the main and secondary texture

Public variables

U4DEngine::U4DVertexData bodyCoordinates
Object which contains attribute data such as vertices, and uv-coordinates.
U4DEngine::U4DTextureData textureInformation
Object which contains texture information.

Function documentation

U4DEngine::U4DMultiImage::U4DMultiImage(const char* uTextureOne, const char* uTextureTwo, float uWidth, float uHeight)

Constructor of class.

Parameters
uTextureOne main texture image
uTextureTwo secondary texture image
uWidth width of texture
uHeight height of texture

void U4DEngine::U4DMultiImage::render(id<MTLRenderCommandEncoder> uRenderEncoder) virtual

Renders the current entity.

Parameters
uRenderEncoder Metal encoder object for the current entity

Updates the space matrix and any rendering flags. It encodes the pipeline, buffers and issues the draw command

void U4DEngine::U4DMultiImage::setImage(const char* uTextureOne, const char* uTextureTwo, float uWidth, float uHeight)

sets the image textures

Parameters
uTextureOne main texture image
uTextureTwo secondary texture image
uWidth width of texture
uHeight height of texture

bool U4DEngine::U4DMultiImage::getImageState() virtual

current state of the image. Used for multi-image entities such as buttons to change between the main and secondary texture

Returns state of the image

void U4DEngine::U4DMultiImage::setImageState(bool uValue) virtual

sets the state of the image. Used for multi-image entities such as buttons to change between the main and secondary texture

Parameters
uValue sets the flag to true when the image should change