ImageFill
Provides shaded rendering using an image as the fill for a shape or geometry.
The ImageFill
class enables customization of how an image is applied as a fill, providing properties to control image source, scaling, positioning, and orientation. This is achieved through shader-based rendering, with configurable parameters for precise control over the resulting visual representation.
Image behavior is determined by the following properties:
image
: The image to be used as the fill, represented as aColorBuffer
.flipV
: A flag to vertically flip the image. This is useful when the vertical orientation of the original image needs correction.position
: AVector2
specifying the offset positioning for the image within the bounds of the shape.useScreenBounds
: When enabled, adjusts the image mapping to use the screen space bounds rather than the shape's bounds.
The rendering logic dynamically adjusts the image's aspect ratio and alignment, maintaining proportional scaling between the image and target bounds. This ensures correct rendering for shapes of varying sizes or orientations.