HumHub Documentation (unofficial)

BoxInterface

Interface for a box.

Table of Contents

Methods

__toString()  : string
Returns a string representation of the current box.
contains()  : bool
Checks whether current box can fit given box at a given start position, start position defaults to top left corner xy(0,0).
getHeight()  : int
Gets box height.
getWidth()  : int
Gets box width.
heighten()  : static
Resizes box to given height, constraining proportions and returns the new box.
increase()  : static
Creates new BoxInterface, adding given size to both sides.
scale()  : static
Creates new BoxInterface instance with ratios applied to both sides.
square()  : int
Gets current box square, useful for getting total number of pixels in a given box.
widen()  : static
Resizes box to given width, constraining proportions and returns the new box.

Methods

__toString()

Returns a string representation of the current box.

public __toString() : string
Return values
string

getHeight()

Gets box height.

public getHeight() : int
Return values
int

getWidth()

Gets box width.

public getWidth() : int
Return values
int

heighten()

Resizes box to given height, constraining proportions and returns the new box.

public heighten(int $height) : static
Parameters
$height : int
Return values
static

increase()

Creates new BoxInterface, adding given size to both sides.

public increase(int $size) : static
Parameters
$size : int
Return values
static

scale()

Creates new BoxInterface instance with ratios applied to both sides.

public scale(float $ratio) : static
Parameters
$ratio : float
Return values
static

square()

Gets current box square, useful for getting total number of pixels in a given box.

public square() : int
Return values
int

widen()

Resizes box to given width, constraining proportions and returns the new box.

public widen(int $width) : static
Parameters
$width : int
Return values
static

        
On this page

Search results