![]() |
Gorgon Game Engine
|
This class allows control over a sizable object. More...
Public Types | |
enum | Tiling { Single, Stretch, Tile, Integral_Smaller, Integral_Fill, Integral_Best } |
Controls how a direction is tiled. More... | |
Public Member Functions | |
SizeController () | |
Creates a default size controller which tiles the object from top-left. More... | |
SizeController (Graphics::Tiling tile, Placement p=Placement::TopLeft) | |
Creates a new size controller with the given tiling options and placement. More... | |
SizeController (Placement p) | |
Creates a size controller that places a single object to the given placement. More... | |
SizeController (Tiling h, Tiling v, Placement p=Placement::TopLeft) | |
Creates a new size controller with the given tiling options and placement. More... | |
Geometry::Rectangle | CalculateArea (const Geometry::Size &objectsize, const Geometry::Size &area) const |
Calculates the drawing area of the object according to the tiling and placement rules. More... | |
Geometry::Rectangle | CalculateArea (const Geometry::Size &repeatingsize, const Geometry::Size &fixedsize, const Geometry::Size &area) const |
Calculates the drawing area of the object according to the tiling and placement rules. More... | |
Geometry::Rectanglef | CalculateArea (const Geometry::Sizef &objectsize, const Geometry::Sizef &area) const |
Calculates the drawing area of the object according to the tiling and placement rules. More... | |
Geometry::Rectangle | CalculateArea (const Geometry::Sizef &repeatingsize, const Geometry::Sizef &fixedsize, const Geometry::Sizef &area) const |
Calculates the drawing area of the object according to the tiling and placement rules. More... | |
Geometry::Point | CalculateOffset (const Geometry::Size &objectsize, const Geometry::Size &area) const |
Calculates the size of the object according to the tiling and placement rules. More... | |
Geometry::Point | CalculateOffset (const Geometry::Size &repeatingsize, const Geometry::Size &fixedsize, const Geometry::Size &area) const |
Calculates the size of the object according to the tiling and placement rules. More... | |
Geometry::Pointf | CalculateOffset (const Geometry::Sizef &objectsize, const Geometry::Sizef &area) const |
Calculates the size of the object according to the tiling and placement rules. More... | |
Geometry::Pointf | CalculateOffset (const Geometry::Sizef &repeatingsize, const Geometry::Sizef &fixedsize, const Geometry::Sizef &area) const |
Calculates the size of the object according to the tiling and placement rules. More... | |
Geometry::Size | CalculateSize (Geometry::Size objectsize, const Geometry::Size &area) const |
Calculates the size of the object according to the tiling rules. More... | |
Geometry::Size | CalculateSize (Geometry::Size repeatingsize, const Geometry::Size &fixedsize, const Geometry::Size &area) const |
Calculates the size of the object according to the tiling rules. More... | |
Geometry::Sizef | CalculateSize (Geometry::Sizef objectsize, const Geometry::Sizef &area) const |
Calculates the size of the object according to the tiling rules. More... | |
Geometry::Sizef | CalculateSize (Geometry::Sizef repeatingsize, const Geometry::Sizef &fixedsize, const Geometry::Sizef &area) const |
Calculates the size of the object according to the tiling rules. More... | |
Graphics::Tiling | GetTiling () const |
Public Attributes | |
Tiling | Horizontal |
Horizontal tiling mode. More... | |
Placement | Place |
Placement method. More... | |
Tiling | Vertical |
Vertical tiling mode. More... | |
This class allows control over a sizable object.
enum Tiling |
Controls how a direction is tiled.
Enumerator | |
---|---|
Single | The drawing is drawn only once with its original size. The placement of this single drawing will be determined by the alignment. |
Stretch | The drawing is stretched along this axis to cover the given size. If the given drawing object is truly scalable, this value acts same as Tile. |
Tile | The drawing is tiled along this axis to cover the given size. If the area is smaller, drawing will be cut from the given size. If the area is larger, drawing will be repeated as necessary. While repeating, it is possible for drawing not to cover the area exactly, In this case, alignment determines which side will be incomplete. If center alignment is selected, both sides will have same amount of incomplete drawing. |
Integral_Smaller | The drawing is tiled along this axis to cover the given size. In this mode, the drawing will never placed incomplete. Instead, it will be repeated to cover as much area as possible without exceeding the given size. Any area that is left will be distributed to the edges according to the selected alignment. |
Integral_Fill | The drawing is tiled along this axis to cover the given size. In this mode, the drawing will never placed incomplete. Instead, it will be repeated to cover entire area. Excess drawing will be aligned depending on the selected alignment. |
Integral_Best | The drawing is tiled along this axis to cover the given size. In this mode, the drawing will never placed incomplete. Instead, it will be repeated to cover entire area. If the last drawing that will be partial is more than 50% of the size of the original drawing, it will be drawn. Excess drawing or the area left empty is distributed according to the selected alignment. |
SizeController | ( | ) |
Creates a default size controller which tiles the object from top-left.
SizeController | ( | Placement | p | ) |
Creates a size controller that places a single object to the given placement.
This is an implicit conversion constructor.
SizeController | ( | Tiling | h, |
Tiling | v, | ||
Placement | p = Placement::TopLeft |
||
) |
Creates a new size controller with the given tiling options and placement.
SizeController | ( | Graphics::Tiling | tile, |
Placement | p = Placement::TopLeft |
||
) |
Creates a new size controller with the given tiling options and placement.
Geometry::Rectangle CalculateArea | ( | const Geometry::Size & | objectsize, |
const Geometry::Size & | area | ||
) | const |
Calculates the drawing area of the object according to the tiling and placement rules.
References Gorgon::Graphics::CalculateOffset(), SizeController::CalculateSize(), and SizeController::Place.
Geometry::Rectangle CalculateArea | ( | const Geometry::Size & | repeatingsize, |
const Geometry::Size & | fixedsize, | ||
const Geometry::Size & | area | ||
) | const |
Calculates the drawing area of the object according to the tiling and placement rules.
References Gorgon::Graphics::CalculateOffset(), SizeController::CalculateSize(), and SizeController::Place.
Geometry::Rectanglef CalculateArea | ( | const Geometry::Sizef & | objectsize, |
const Geometry::Sizef & | area | ||
) | const |
Calculates the drawing area of the object according to the tiling and placement rules.
References Gorgon::Graphics::CalculateOffset(), SizeController::CalculateSize(), and SizeController::Place.
Geometry::Rectangle CalculateArea | ( | const Geometry::Sizef & | repeatingsize, |
const Geometry::Sizef & | fixedsize, | ||
const Geometry::Sizef & | area | ||
) | const |
Calculates the drawing area of the object according to the tiling and placement rules.
References Gorgon::Graphics::CalculateOffset(), SizeController::CalculateSize(), and SizeController::Place.
Geometry::Point CalculateOffset | ( | const Geometry::Size & | objectsize, |
const Geometry::Size & | area | ||
) | const |
Calculates the size of the object according to the tiling and placement rules.
References Gorgon::Graphics::CalculateOffset(), SizeController::CalculateSize(), and SizeController::Place.
Geometry::Point CalculateOffset | ( | const Geometry::Size & | repeatingsize, |
const Geometry::Size & | fixedsize, | ||
const Geometry::Size & | area | ||
) | const |
Calculates the size of the object according to the tiling and placement rules.
References Gorgon::Graphics::CalculateOffset(), SizeController::CalculateSize(), and SizeController::Place.
Geometry::Pointf CalculateOffset | ( | const Geometry::Sizef & | objectsize, |
const Geometry::Sizef & | area | ||
) | const |
Calculates the size of the object according to the tiling and placement rules.
References Gorgon::Graphics::CalculateOffset(), SizeController::CalculateSize(), and SizeController::Place.
Geometry::Pointf CalculateOffset | ( | const Geometry::Sizef & | repeatingsize, |
const Geometry::Sizef & | fixedsize, | ||
const Geometry::Sizef & | area | ||
) | const |
Calculates the size of the object according to the tiling and placement rules.
References Gorgon::Graphics::CalculateOffset(), SizeController::CalculateSize(), and SizeController::Place.
Geometry::Size CalculateSize | ( | Geometry::Size | objectsize, |
const Geometry::Size & | area | ||
) | const |
Calculates the size of the object according to the tiling rules.
References basic_Size< T_ >::Height, SizeController::Horizontal, SizeController::Integral_Best, SizeController::Integral_Fill, SizeController::Integral_Smaller, SizeController::Single, SizeController::Stretch, SizeController::Tile, SizeController::Vertical, and basic_Size< T_ >::Width.
Geometry::Size CalculateSize | ( | Geometry::Size | repeatingsize, |
const Geometry::Size & | fixedsize, | ||
const Geometry::Size & | area | ||
) | const |
Calculates the size of the object according to the tiling rules.
References basic_Size< T_ >::Height, SizeController::Horizontal, SizeController::Integral_Best, SizeController::Integral_Fill, SizeController::Integral_Smaller, SizeController::Single, SizeController::Stretch, SizeController::Tile, SizeController::Vertical, and basic_Size< T_ >::Width.
Geometry::Sizef CalculateSize | ( | Geometry::Sizef | objectsize, |
const Geometry::Sizef & | area | ||
) | const |
Calculates the size of the object according to the tiling rules.
References basic_Size< T_ >::Height, SizeController::Horizontal, SizeController::Integral_Best, SizeController::Integral_Fill, SizeController::Integral_Smaller, SizeController::Single, SizeController::Stretch, SizeController::Tile, SizeController::Vertical, and basic_Size< T_ >::Width.
Geometry::Sizef CalculateSize | ( | Geometry::Sizef | repeatingsize, |
const Geometry::Sizef & | fixedsize, | ||
const Geometry::Sizef & | area | ||
) | const |
Calculates the size of the object according to the tiling rules.
References basic_Size< T_ >::Height, SizeController::Horizontal, SizeController::Integral_Best, SizeController::Integral_Fill, SizeController::Integral_Smaller, SizeController::Single, SizeController::Stretch, SizeController::Tile, SizeController::Vertical, and basic_Size< T_ >::Width.
Graphics::Tiling GetTiling | ( | ) | const |
Tiling Horizontal |
Horizontal tiling mode.
Placement Place |
Placement method.
Tiling Vertical |
Vertical tiling mode.