uvi-script
Musical event scripting with Lua
Loading...
Searching...
No Matches
RectanglePlacement Class Reference

Image placement and alignment options. More...

Public Types

enum  Type {
  Left ,
  Right ,
  HorizontallyCentred ,
  Top ,
  Bottom ,
  VerticallyCentred ,
  StretchToFit ,
  FillDestination ,
  OnlyReduceInSize ,
  OnlyIncreaseInSize ,
  DoNotResize ,
  Centred
}
 Placement type enumeration. More...
 

Detailed Description

Image placement and alignment options.

Defines how images are positioned and scaled within their container bounds. Used by widgets like Image to control image alignment and scaling behavior.

Usage Example:

local img = Image("resources/logo.png")
img.rectanglePlacement = RectanglePlacement.Centred
img.bounds = {0, 0, 200, 100}
Image widget.
Definition ui.cpp:922
Image placement and alignment options.
Definition ui.cpp:668
@ Centred
Center image both horizontally and vertically.
Definition ui.cpp:686

Member Enumeration Documentation

◆ Type

Placement type enumeration.

Specifies how an image should be positioned and scaled within its bounds.

Enumerator
Left 

Align image to the left edge.

Right 

Align image to the right edge.

HorizontallyCentred 

Center image horizontally.

Top 

Align image to the top edge.

Bottom 

Align image to the bottom edge.

VerticallyCentred 

Center image vertically.

StretchToFit 

Stretch image to fill container (may distort aspect ratio)

FillDestination 

Scale image to fill container while maintaining aspect ratio (may crop)

OnlyReduceInSize 

Only scale down if image is larger than container.

OnlyIncreaseInSize 

Only scale up if image is smaller than container.

DoNotResize 

Keep image at original size.

Centred 

Center image both horizontally and vertically.