pub struct RectFrame {
pub color: FillColor,
pub image: Option<ImageHandle>,
pub top_left: FramePoint2d,
pub bottom_right: FramePoint2d,
pub corner_radius: Corners<f32>,
}Expand description
A rectangular frame
Can optionally be tinted, textured, and have rounded corners
Fields§
§color: FillColorBackground color of the frame\
If the container has a background texture, it will be multiplied by this color
image: Option<ImageHandle>Background texture of the frame
Can be used in conjunction with the background color
In this case, the texture will be shaded by the color
Please note that if the background color is NOT set (or set to transparent), the texture will NOT be visible
This is because the texture is multiplied by the color, and if the color is transparent, the texture will be too\
top_left: FramePoint2dTop left corner of the rectangle
bottom_right: FramePoint2dBottom right corner of the rectangle
corner_radius: Corners<f32>Corner radius of the frame
Implementations§
Source§impl RectFrame
impl RectFrame
Sourcepub fn image(image: ImageHandle) -> Self
pub fn image(image: ImageHandle) -> Self
Sourcepub fn color_image(color: impl Into<FillColor>, image: ImageHandle) -> Self
pub fn color_image(color: impl Into<FillColor>, image: ImageHandle) -> Self
Create a new RectFrame with the given color and image
Sourcepub fn with_corner_radius(self, radius: impl Into<Corners<f32>>) -> Self
pub fn with_corner_radius(self, radius: impl Into<Corners<f32>>) -> Self
Set the corner radius of the RectFrame
Sourcepub fn with_inset(self, inset: f32) -> Self
pub fn with_inset(self, inset: f32) -> Self
Inset the rectangle by the given amount in pixels