Skip to main content

Gizmos

Struct Gizmos 

Source
pub struct Gizmos { /* private fields */ }
Expand description

What one frame hands in: the gizmos of the channels that are on, in the order they were pushed, and every channel offered, on or off. It knows the frame’s pixels (frame), so a helper can keep its gizmos on it.

Implementations§

Source§

impl Gizmos

Source

pub fn new() -> Self

A frame’s list with no channel on: it only gathers the channels offered.

Source

pub fn within(self, pixels: PxRect) -> Self

The same list for a frame of pixels (the buffer’s pixel_bounds).

Source

pub fn frame(&self) -> PxRect

The frame’s pixels: what a helper keeps its gizmos inside. Nearly all of i32 unless the list was told (within); the game tells it the buffer’s.

Source

pub fn with_on<'a>(ids: impl IntoIterator<Item = &'a str>) -> Self

A frame’s list with the channels of these ids on.

Source

pub fn all_on() -> Self

A frame’s list with every channel on.

Source

pub fn channel_on(&mut self, channel: Channel) -> bool

Whether channel is on, which also offers it (the debug menu lists it). A channel’s helper asks first and does nothing more when it is off.

Source

pub fn push(&mut self, channel: Channel, role: GizmoRole, gizmo: Gizmo)

Adds gizmo of channel, showing role, after those already pushed, if the channel is on; it is dropped if not. Either way the channel is offered.

Source

pub fn drawn(&self) -> &[Drawn]

The gizmos kept, in the order pushed.

Source

pub fn len(&self) -> usize

How many gizmos were kept.

Source

pub fn is_empty(&self) -> bool

Whether none was kept.

Source

pub fn offered(&self) -> &[Channel]

Every channel offered, on or off, in the order first offered.

Trait Implementations§

Source§

impl Clone for Gizmos

Source§

fn clone(&self) -> Gizmos

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Gizmos

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Gizmos

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for Gizmos

Source§

impl PartialEq for Gizmos

Source§

fn eq(&self, other: &Gizmos) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Gizmos

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.