struct
CBrush
- Module
- Miri
- Header
#include "Miri/Style/CMiriStyle.h"- Namespace
Miri
Properties
| Type | Name | Description |
|---|---|---|
EBrushDrawMode | DrawMode | Default EBrushDrawMode::Rounded. |
CMiriStyleColor | Tint | |
MiriMargin | Margin | For 9-slice borders |
FMiriCornerRadii | Radii | |
CMiriStyleColor | BorderColor | An 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). |
float | BorderThickness | Default 0.0f. |
std::vector<FMiriShadow> | Shadows | Drawn first, outside-in, under the fill. |
std::shared_ptr<const FMiriGradient> | Gradient | Replaces the solid fill when set. Image brushes ignore it. |
float | Opacity | Multiplies every colour the brush draws. Default 1.0f. |
Ref<IMiriRHITexture> | Image | Owning reference — a style set outlives the widgets that read it, so a brush must keep its texture alive on its own. |
MiriVec2 | TileSize | Tiled mode only; non-positive components fall back to the texture size. |
MiriVec2 | UVMin | Default MiriVec2(0.0f, 0.0f). |
MiriVec2 | UVMax | Default MiriVec2(1.0f, 1.0f). |
MiriVec2 | ImageSize | Default MiriVec2(0.0f, 0.0f). |
int32_t | BackdropLevel | Default -1. |
std::shared_ptr<const FMiriCustomMaterial> | Material | |
MiriVec4[FMiriCustomMaterial::kMaxLanes] | MaterialLanes |
Public functions
| Returns | Name | Description |
|---|---|---|
bool | CanRetain | |
bool | SetMaterialParam | |
void | SetSprite | |
bool | HasSubrect | |
MiriVec2 | GetSourceSize | |
CBrush | RoundedBox | |
CBrush | None | |
CBrush | StretchedImage | |
CBrush | TiledImage | |
CBrush | NineSliceImage | |
CBrush | RoundedImage | |
void | Draw | Paints the brush into rect, honoring DrawMode. |
void | Draw |
Function details
CanRetain
C++
bool CanRetain() constSetMaterialParam
C++
bool SetMaterialParam(const std::string& name, const MiriVec4& value, bool* outChanged = nullptr)SetSprite
C++
void SetSprite(const FMiriSprite& sprite)HasSubrect
C++
bool HasSubrect() constGetSourceSize
C++
MiriVec2 GetSourceSize() constRoundedBox
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) constPaints 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) constGenerated from Miri/Style/CMiriStyle.h via miri.json · Dec 5, 2026Version 1.1.0