UTFWin::DialogDrawable class

The standard IDrawable for a dialog component.

Base classes

class IDrawable
A class that is capable of drawing a user interface component.
class DefaultLayoutElement
A default implementation of ILayoutElement.
class IDialogDrawable
An abstract class that has the methods that a drawable for a dialog would require.

Public static variables

static const uint32_t TYPE

Constructors, destructors, conversion operators

DialogDrawable()
~DialogDrawable() virtual

Public functions

auto AddRef() -> int override
auto Release() -> int override
auto Cast(uint32_t type) const -> void* override
auto SetSerializer(Serializer& dst) -> void override
auto GetProxyID() const -> uint32_t override
Returns the ID that identifies this type of element in a SPUI file.
auto Paint(UIRenderer* pRenderer, const Math::Rectangle& area, const RenderParams& params) -> void override
Paints this drawable onto the given UIRenderer.
auto IsColliding(const Math::Rectangle& area, const Math::Point& point, RenderParams& params) -> bool override
Tells whether the point specified is colliding in this drawable or not.
auto GetDimensions(Dimensions& dst, int state, int index) -> bool override
Used to get the dimensions of an image contained in this drawable.
auto UseCollision(uint32_t type, bool& dst) -> bool override
Tells whether the collision of a window should be handled by this drawable or not.
auto ToDrawable() -> IDrawable* override
Get the IDrawable instance that represents this class.
auto SetImage(int index, Image* image) -> void override
Set the images used by this drawable.
auto GetBackgroundColor(Color& dst) const -> Color override
Gets the color used to fill the background.
auto SetBackgroundColor(Color color) -> void override
Sets the color used to fill the background.
auto GetBackgroundTiling(BackgroundTiling& dst) const -> BackgroundTiling override
Gets the tiling mode used to fill the background.
auto SetBackgroundTiling(BackgroundTiling value) -> void override
Sets the color used to fill the background.

Protected variables

Color mBackgroundFillColor
BackgroundTiling mBackgroundTiling
ImagePtr mpImages

Function documentation

void UTFWin::DialogDrawable::Paint(UIRenderer* pRenderer, const Math::Rectangle& area, const RenderParams& params) override

Paints this drawable onto the given UIRenderer.

Parameters
pRenderer The UIRenderer where this must be drawn.
area The area of the window to draw.
params RenderParams that contain additional information (e.g. what image do draw, the current state, etc).

bool UTFWin::DialogDrawable::IsColliding(const Math::Rectangle& area, const Math::Point& point, RenderParams& params) override

Tells whether the point specified is colliding in this drawable or not.

Parameters
area The area of the window that is using this drawable.
point The Point to check whether it collides or not. Its coordinates are relative to the window position.
params Additional information, probably unused.

This method is useful for drawables that use hitmasks.

bool UTFWin::DialogDrawable::GetDimensions(Dimensions& dst, int state, int index) override

Used to get the dimensions of an image contained in this drawable.

Parameters
dst out The Dimensions where the result must be written.
state The current state flags of the window.
index The index of the image whose dimensions must be returned.
Returns True if the dimensions were got, false otherwise.

bool UTFWin::DialogDrawable::UseCollision(uint32_t type, bool& dst) override

Tells whether the collision of a window should be handled by this drawable or not.

Parameters
type The type, usually kDefaultCollisionType.
dst out If the collision type is supported, whether it must be handled by this drawable or not.
Returns True if the collision type is supported (even if it's not handled by this drawable), false otherwise.

void UTFWin::DialogDrawable::SetImage(int index, Image* image) override

Set the images used by this drawable.

Parameters
index The index of the image to set.
image

The index is one of the AbstractDialogDrawable::kImage... values.

Color UTFWin::DialogDrawable::GetBackgroundColor(Color& dst) const override

Gets the color used to fill the background.

Parameters
dst The Color where the value will be set.
Returns The background fill color.

void UTFWin::DialogDrawable::SetBackgroundColor(Color color) override

Sets the color used to fill the background.

Parameters
color The new Color value.
Returns The background fill color.

BackgroundTiling UTFWin::DialogDrawable::GetBackgroundTiling(BackgroundTiling& dst) const override

Gets the tiling mode used to fill the background.

Parameters
dst The BackgroundTiling where the value will be set.
Returns The background tiling mode.

void UTFWin::DialogDrawable::SetBackgroundTiling(BackgroundTiling value) override

Sets the color used to fill the background.

Parameters
value The new tiling value, from the BackgroundTiling enum.
Returns The background tiling mode.