UTFWin::StdDrawable class

The standard IDrawable for user interactive components.

Check AbstractStdDrawable for more information.

Base classes

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

Derived classes

class SporeStdDrawable

Constructors, destructors, conversion operators

StdDrawable()
~StdDrawable() virtual

Public functions

auto AddRef() -> int override
auto Release() -> int override
auto Cast(uint32_t type) const -> void* override
void SetSerializer(Serializer& dst) override
auto GetProxyID() const -> uint32_t override
Returns the ID that identifies this type of element in a SPUI file.
void Paint(UIRenderer* pRenderer, const Math::Rectangle& area, const RenderParams& params) 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 GetImage(StateIndices index) const -> Image* override
Gets the image for the specified state.
void SetImage(StateIndices index, Image* pImage) override
Sets the image for the specified state.
auto GetScaleType() const -> Scaling override
Specifies how the image should be stretched when the window changes size.
void SetScaleType(Scaling value) override
Specifies how the image should be stretched when the window changes size.
auto GetScaleArea() const -> const Math::Rectangle& override
Indicates the width of each non-stretched edge, as a proportion of image size (0 to 1).
void SetScaleArea(const Math::Rectangle& value) override
Indicates the width of each non-stretched edge, as a proportion of image size (0 to 1).
auto GetScaleFactor() const -> const Vector2& override
Gets the scaling factor for the non-stretched portions of the artwork.
void SetScaleFactor(Vector2& value) override
Sets the scaling factor for the non-stretched portions of the artwork.
auto GetHitMask() const -> Object* override
Gets the hit mask for this drawable.
void SetHitMask(Object* pHitMask) override
Sets the hit mask for this drawable.
auto GetHitFactor() const -> float override
void SetHitFactor(float value) override

Protected variables

intrusive_ptr<Image> mpImages
Scaling mScaleType
Math::Rectangle mScaleArea
Math::Vector2 mScaleFactor
intrusive_ptr<Object> mpHitMask
float property_0F3C000E
OutlineFormat mImageOutline

Function documentation

void UTFWin::StdDrawable::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::StdDrawable::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::StdDrawable::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::StdDrawable::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.

Image* UTFWin::StdDrawable::GetImage(StateIndices index) const override

Gets the image for the specified state.

Parameters
index The index for the state required.

void UTFWin::StdDrawable::SetImage(StateIndices index, Image* pImage) override

Sets the image for the specified state.

Parameters
index The index for the state required.
pImage The image.

void UTFWin::StdDrawable::SetScaleType(Scaling value) override

Specifies how the image should be stretched when the window changes size.

Parameters
value The new value, from the Scaling enumeration.

void UTFWin::StdDrawable::SetScaleArea(const Math::Rectangle& value) override

Indicates the width of each non-stretched edge, as a proportion of image size (0 to 1).

Parameters
value The new value.

void UTFWin::StdDrawable::SetScaleFactor(Vector2& value) override

Sets the scaling factor for the non-stretched portions of the artwork.

Parameters
value A Vector2 value containing the X and Y scale.

void UTFWin::StdDrawable::SetHitMask(Object* pHitMask) override

Sets the hit mask for this drawable.

Parameters
pHitMask The new hit mask object.