pub struct Pos2 {
pub x: f32,
pub y: f32,
}
Expand description
A position on screen.
Normally given in points (logical pixels).
Mathematically this is known as a “point”, but the term position was chosen so not to
conflict with the unit (one point = X physical pixels).
The zero position, the origin.
The top left corner in a GUI.
Same as Pos2::default()
.
👎 Deprecated:
Use Pos2::ZERO instead
The vector from origin to this position.
p.to_vec2()
is equivalent to p - Pos2::default()
.
True if all members are also finite.
True if any member is NaN.
The resulting type after applying the +
operator.
Performs copy-assignment from source
. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
The returned type after indexing.
Performs the indexing (container[index]
) operation. Read more
Performs the mutable indexing (container[index]
) operation. Read more
More readable version of self.max(lower_limit)
More readable version of self.min(upper_limit)
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
The resulting type after applying the -
operator.
The resulting type after applying the -
operator.
impl<T> Any for T where
T: 'static + ?Sized,
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
impl<T, U> Into<U> for T where
U: From<T>,
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
The type returned in the event of a conversion error.