# TileBrush

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/media/struct-tilebrush/

**struct** · [`ferroui-base`](/docs/0.5.0/api/ferroui-base/) · v0.5.0

```rust
struct TileBrush
```

Base class for brushes which display repeating images.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/tile_brush.rs#L9)

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`alignment_x_property`](#function-alignment_x_property)
- [`alignment_y_property`](#function-alignment_y_property)
- [`destination_rect_property`](#function-destination_rect_property)
- [`source_rect_property`](#function-source_rect_property)
- [`stretch_property`](#function-stretch_property)
- [`tile_mode_property`](#function-tile_mode_property)
- [`construct`](#function-construct)
- [`alignment_x`](#function-alignment_x)
- [`set_alignment_x`](#function-set_alignment_x)
- [`alignment_y`](#function-alignment_y)
- [`set_alignment_y`](#function-set_alignment_y)
- [`destination_rect`](#function-destination_rect)
- [`set_destination_rect`](#function-set_destination_rect)
- [`source_rect`](#function-source_rect)
- [`set_source_rect`](#function-set_source_rect)
- [`stretch`](#function-stretch)
- [`set_stretch`](#function-set_stretch)
- [`tile_mode`](#function-tile_mode)
- [`set_tile_mode`](#function-set_tile_mode)

<a id="assoc_const-type"></a>

### TYPE

```rust
const TYPE: &'static $crate::TypeInfo
```

The runtime type of this class.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/tile_brush.rs#L13)

<a id="function-to_ref"></a>

### to_ref

```rust
fn to_ref(self: &Self) -> $crate::Ref<TileBrush>
```

Returns a strong reference to this object.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/tile_brush.rs#L13)

<a id="function-alignment_x_property"></a>

### alignment_x_property

```rust
fn alignment_x_property() -> &'static StyledProperty<AlignmentX>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/tile_brush.rs#L31)

<a id="function-alignment_y_property"></a>

### alignment_y_property

```rust
fn alignment_y_property() -> &'static StyledProperty<AlignmentY>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/tile_brush.rs#L31)

<a id="function-destination_rect_property"></a>

### destination_rect_property

```rust
fn destination_rect_property() -> &'static StyledProperty<RelativeRect>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/tile_brush.rs#L31)

<a id="function-source_rect_property"></a>

### source_rect_property

```rust
fn source_rect_property() -> &'static StyledProperty<RelativeRect>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/tile_brush.rs#L31)

<a id="function-stretch_property"></a>

### stretch_property

```rust
fn stretch_property() -> &'static StyledProperty<Stretch>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/tile_brush.rs#L31)

<a id="function-tile_mode_property"></a>

### tile_mode_property

```rust
fn tile_mode_property() -> &'static StyledProperty<TileMode>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/tile_brush.rs#L31)

<a id="function-construct"></a>

### construct

```rust
fn construct() -> Self
```

Creates the class data.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/tile_brush.rs#L59)

<a id="function-alignment_x"></a>

### alignment_x

```rust
fn alignment_x(self: &Self) -> AlignmentX
```

The horizontal alignment of a tile in the destination.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/tile_brush.rs#L64)

<a id="function-set_alignment_x"></a>

### set_alignment_x

```rust
fn set_alignment_x(self: &Self, value: AlignmentX)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/tile_brush.rs#L68)

<a id="function-alignment_y"></a>

### alignment_y

```rust
fn alignment_y(self: &Self) -> AlignmentY
```

The vertical alignment of a tile in the destination.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/tile_brush.rs#L73)

<a id="function-set_alignment_y"></a>

### set_alignment_y

```rust
fn set_alignment_y(self: &Self, value: AlignmentY)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/tile_brush.rs#L77)

<a id="function-destination_rect"></a>

### destination_rect

```rust
fn destination_rect(self: &Self) -> RelativeRect
```

The rectangle on the destination in which to paint a tile.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/tile_brush.rs#L82)

<a id="function-set_destination_rect"></a>

### set_destination_rect

```rust
fn set_destination_rect(self: &Self, value: RelativeRect)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/tile_brush.rs#L86)

<a id="function-source_rect"></a>

### source_rect

```rust
fn source_rect(self: &Self) -> RelativeRect
```

The rectangle of the source image that will be displayed.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/tile_brush.rs#L91)

<a id="function-set_source_rect"></a>

### set_source_rect

```rust
fn set_source_rect(self: &Self, value: RelativeRect)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/tile_brush.rs#L95)

<a id="function-stretch"></a>

### stretch

```rust
fn stretch(self: &Self) -> Stretch
```

A value controlling how the source rectangle will be stretched to
fill the destination rect.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/tile_brush.rs#L101)

<a id="function-set_stretch"></a>

### set_stretch

```rust
fn set_stretch(self: &Self, value: Stretch)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/tile_brush.rs#L105)

<a id="function-tile_mode"></a>

### tile_mode

```rust
fn tile_mode(self: &Self) -> TileMode
```

The brush's tile mode.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/tile_brush.rs#L110)

<a id="function-set_tile_mode"></a>

### set_tile_mode

```rust
fn set_tile_mode(self: &Self, value: TileMode)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/tile_brush.rs#L114)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`BrushImplExt`](/docs/0.5.0/api/ferroui-base/media/trait-brushimplext/)
- [`FerroObjectImplExt`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimplext/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- [`Receiver`](/docs/0.5.0/api/ferroui-system/task/oneshot/struct-receiver/)
- `Any`
- `ErasedDestructor`
- `IntoEither`
- `Deref`
- [`Upcast<T>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`Upcast<TileBrush>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`StaticType`](/docs/0.5.0/api/ferroui-base/trait-statictype/)
- [`ObjectType`](/docs/0.5.0/api/ferroui-base/trait-objecttype/)
- [`Subclassable<T>`](/docs/0.5.0/api/ferroui-base/trait-subclassable/)
- [`FerroObjectImpl`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimpl/)
- [`BrushImpl`](/docs/0.5.0/api/ferroui-base/media/trait-brushimpl/)

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
