RepeatableImageFill
in package
implements
FillInterface
FinalYes
Tiled/repeatable image background fill.
Tags
Table of Contents
Interfaces
- FillInterface
- Interface for all fill types.
Constants
- REPEAT_BOTH = 'both'
- Valid repeat modes.
- REPEAT_NONE = 'none'
- REPEAT_X = 'x'
- REPEAT_Y = 'y'
Properties
- $height : int|null
- The height of each tile.
- $repeat : string|null
- The repeat mode.
- $url : string
- $width : int|null
- The width of each tile.
Methods
- __construct() : mixed
- Create a new RepeatableImageFill.
- fromBundle() : self
- Create a RepeatableImageFill from a bundle file.
- fromUrl() : self
- Create a RepeatableImageFill from a URL.
- getType() : string
- Get the fill type identifier.
- jsonSerialize() : array<string, mixed>
- {@inheritdoc}
- repeatBoth() : $this
- Set to repeat in both directions.
- repeatX() : $this
- Set to repeat horizontally only.
- repeatY() : $this
- Set to repeat vertically only.
- setHeight() : $this
- Set the tile height.
- setRepeat() : $this
- Set the repeat mode.
- setSize() : $this
- Set the tile size.
- setWidth() : $this
- Set the tile width.
Constants
REPEAT_BOTH
Valid repeat modes.
public
mixed
REPEAT_BOTH
= 'both'
REPEAT_NONE
public
mixed
REPEAT_NONE
= 'none'
REPEAT_X
public
mixed
REPEAT_X
= 'x'
REPEAT_Y
public
mixed
REPEAT_Y
= 'y'
Properties
$height
The height of each tile.
private
int|null
$height
= null
$repeat
The repeat mode.
private
string|null
$repeat
= null
$url read-only
private
string
$url
$width
The width of each tile.
private
int|null
$width
= null
Methods
__construct()
Create a new RepeatableImageFill.
public
__construct(string $url) : mixed
Parameters
- $url : string
-
The image URL.
fromBundle()
Create a RepeatableImageFill from a bundle file.
public
static fromBundle(string $filename) : self
Parameters
- $filename : string
-
The filename in the bundle.
Return values
self —A new instance.
fromUrl()
Create a RepeatableImageFill from a URL.
public
static fromUrl(string $url) : self
Parameters
- $url : string
-
The image URL.
Return values
self —A new instance.
getType()
Get the fill type identifier.
public
getType() : string
Return values
string —The fill type.
jsonSerialize()
{@inheritdoc}
public
jsonSerialize() : array<string, mixed>
Return values
array<string, mixed>repeatBoth()
Set to repeat in both directions.
public
repeatBoth() : $this
Return values
$thisrepeatX()
Set to repeat horizontally only.
public
repeatX() : $this
Return values
$thisrepeatY()
Set to repeat vertically only.
public
repeatY() : $this
Return values
$thissetHeight()
Set the tile height.
public
setHeight(int $height) : $this
Parameters
- $height : int
-
The height in points.
Return values
$thissetRepeat()
Set the repeat mode.
public
setRepeat(string $repeat) : $this
Parameters
- $repeat : string
-
One of 'both', 'x', 'y', 'none'.
Return values
$thissetSize()
Set the tile size.
public
setSize(int $width, int $height) : $this
Parameters
- $width : int
-
The width in points.
- $height : int
-
The height in points.
Return values
$thissetWidth()
Set the tile width.
public
setWidth(int $width) : $this
Parameters
- $width : int
-
The width in points.