Struct mooeye::ui::UiDrawParam
source · pub struct UiDrawParam {
pub target: Rect,
pub mouse_listen: bool,
pub param: DrawParam,
}
Expand description
An extension of the ggez::graphics::DrawParam struct specifically for UiElements.
Fields§
§target: Rect
The rectangular target area this element shall be drawn to.
mouse_listen: bool
Wether or not the element should listen to the mouse position and possible change its visuals or display a tooltip when hovered over.
param: DrawParam
A basic draw param struct to manage things like z-level, color and src-rect. Setting dest_rect may yield unexpected behaviour, as it will likely be overwritten by target when drawing.
Implementations§
source§impl UiDrawParam
impl UiDrawParam
sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new UiDrawParam with default values.
sourcepub fn target(self, target: Rect) -> Self
pub fn target(self, target: Rect) -> Self
Returns a new UiDrawParam with the specified target area.
sourcepub fn mouse_listen(self, mouse_listen: bool) -> Self
pub fn mouse_listen(self, mouse_listen: bool) -> Self
Returns a new UiDrawParam with the specified mouse_listen value.
sourcepub fn z_level(self, z_level: i32) -> Self
pub fn z_level(self, z_level: i32) -> Self
Returns a new UiDrawParam with only the z value of the contained param set to the specified value.
sourcepub fn param(self, param: DrawParam) -> Self
pub fn param(self, param: DrawParam) -> Self
Returns a new UiDrawParam with the entire DrawParam replaced by the specified value.
Trait Implementations§
source§impl Clone for UiDrawParam
impl Clone for UiDrawParam
source§fn clone(&self) -> UiDrawParam
fn clone(&self) -> UiDrawParam
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for UiDrawParam
impl Debug for UiDrawParam
source§impl Default for UiDrawParam
impl Default for UiDrawParam
source§fn default() -> UiDrawParam
fn default() -> UiDrawParam
source§impl From<DrawParam> for UiDrawParam
impl From<DrawParam> for UiDrawParam
source§impl From<UiDrawParam> for DrawParam
impl From<UiDrawParam> for DrawParam
source§fn from(value: UiDrawParam) -> Self
fn from(value: UiDrawParam) -> Self
source§impl PartialEq<UiDrawParam> for UiDrawParam
impl PartialEq<UiDrawParam> for UiDrawParam
source§fn eq(&self, other: &UiDrawParam) -> bool
fn eq(&self, other: &UiDrawParam) -> bool
self
and other
values to be equal, and is used
by ==
.