Struct pixel_game_lib::gui::button::Button
source · pub struct Button {
pub offset: Vec2<f64>,
pub size: Extent2<f64>,
pub click_region: Option<Rect<f64, f64>>,
pub label: Option<String>,
pub state: State,
pub node: Node,
pub assets: ButtonAssetPaths,
}
Expand description
A simple button widget.
Fields§
§offset: Vec2<f64>
Top-left position of the widget in pixels.
size: Extent2<f64>
Size of the button in pixels.
click_region: Option<Rect<f64, f64>>
Extra size of the click region in pixels.
Relative to the offset.
label: Option<String>
A custom label with text centered at the button.
state: State
Current button state.
node: Node
Taffy layout node.
assets: ButtonAssetPaths
Where to load the assets.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Button
impl Send for Button
impl Sync for Button
impl Unpin for Button
impl UnwindSafe for Button
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian()
.