struct

CBrush

Module
Miri
Header
#include "Miri/Style/CMiriStyle.h"
Namespace
Miri

Properties

TypeNameDescription
EBrushDrawModeDrawModeDefault EBrushDrawMode::Rounded.
CMiriStyleColorTint
MiriMarginMarginFor 9-slice borders
FMiriCornerRadiiRadii
CMiriStyleColorBorderColorAn outline drawn with the fill (DrawBox), or over an image or gradient fill. Zero thickness is no border. Default MiriColor(0.0f, 0.0f, 0.0f, 0.0f).
floatBorderThicknessDefault 0.0f.
std::vector<FMiriShadow>ShadowsDrawn first, outside-in, under the fill.
std::shared_ptr<const FMiriGradient>GradientReplaces the solid fill when set. Image brushes ignore it.
floatOpacityMultiplies every colour the brush draws. Default 1.0f.
Ref<IMiriRHITexture>ImageOwning reference — a style set outlives the widgets that read it, so a brush must keep its texture alive on its own.
MiriVec2TileSizeTiled mode only; non-positive components fall back to the texture size.
MiriVec2UVMinDefault MiriVec2(0.0f, 0.0f).
MiriVec2UVMaxDefault MiriVec2(1.0f, 1.0f).
MiriVec2ImageSizeDefault MiriVec2(0.0f, 0.0f).
int32_tBackdropLevelDefault -1.
std::shared_ptr<const FMiriCustomMaterial>Material
MiriVec4[FMiriCustomMaterial::kMaxLanes]MaterialLanes

Public functions

ReturnsNameDescription
boolCanRetain
boolSetMaterialParam
voidSetSprite
boolHasSubrect
MiriVec2GetSourceSize
CBrushRoundedBox
CBrushNone
CBrushStretchedImage
CBrushTiledImage
CBrushNineSliceImage
CBrushRoundedImage
voidDrawPaints the brush into rect, honoring DrawMode.
voidDraw

Function details

CanRetain

C++
bool CanRetain() const

SetMaterialParam

C++
bool SetMaterialParam(const std::string& name, const MiriVec4& value, bool* outChanged = nullptr)

SetSprite

C++
void SetSprite(const FMiriSprite& sprite)

HasSubrect

C++
bool HasSubrect() const

GetSourceSize

C++
MiriVec2 GetSourceSize() const

RoundedBox

C++
static CBrush RoundedBox(const CMiriStyleColor& color, float radius)

None

C++
static CBrush None()

StretchedImage

C++
static CBrush StretchedImage(const Ref<IMiriRHITexture>& image, const MiriColor& tint = MiriColor::White)

TiledImage

C++
static CBrush TiledImage(const Ref<IMiriRHITexture>& image, const MiriVec2& tileSize, const MiriColor& tint = MiriColor::White)

NineSliceImage

C++
static CBrush NineSliceImage(const Ref<IMiriRHITexture>& image, const MiriMargin& borders, const MiriColor& tint = MiriColor::White)

RoundedImage

C++
static CBrush RoundedImage(const Ref<IMiriRHITexture>& image, float radius, const MiriColor& tint = MiriColor::White)

Draw

C++
void Draw(CMiriRenderer& renderer, const MiriRect& rect, float opacity = 1.0f) const

Paints the brush into rect, honoring DrawMode. Image-less brushes degrade to a solid (rounded) rect so every style stays paintable.

Draw

C++
void Draw(CMiriRenderer& renderer, const MiriRect& rect, const MiriColor& tintOverride, float opacity) const
Generated from Miri/Style/CMiriStyle.h via miri.json · Dec 5, 2026Version 1.1.0