Struct emath::Pos2[][src]

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).

Fields

x: f32y: f32

Implementations

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.

Trait Implementations

The resulting type after applying the + operator.

Performs the + operation. Read more

Performs the += operation. Read more

Returns a copy of the value. Read more

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

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

Performs the mutable indexing (container[index]) operation. Read more

Transforms the position.

The resulting type after applying the * operator.

Performs the * operation. Read more

Transforms the position.

The resulting type after applying the * operator.

Performs the * 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.

Performs the - operation. Read more

The resulting type after applying the - operator.

Performs the - operation. Read more

Performs the -= operation. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

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)

recently added

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.