spitfire_draw::text

Struct Text

Source
pub struct Text {
Show 13 fields pub shader: Option<ShaderRef>, pub font: Cow<'static, str>, pub size: f32, pub text: Cow<'static, str>, pub tint: Rgba<f32>, pub horizontal_align: HorizontalAlign, pub vertical_align: VerticalAlign, pub width: Option<f32>, pub height: Option<f32>, pub uniforms: HashMap<Cow<'static, str>, GlowUniformValue>, pub transform: Transform<f32, f32, f32>, pub blending: Option<GlowBlending>, pub screen_space: bool,
}

Fields§

§shader: Option<ShaderRef>§font: Cow<'static, str>§size: f32§text: Cow<'static, str>§tint: Rgba<f32>§horizontal_align: HorizontalAlign§vertical_align: VerticalAlign§width: Option<f32>§height: Option<f32>§uniforms: HashMap<Cow<'static, str>, GlowUniformValue>§transform: Transform<f32, f32, f32>§blending: Option<GlowBlending>§screen_space: bool

Implementations§

Source§

impl Text

Source

pub fn new(shader: ShaderRef) -> Self

Source

pub fn shader(self, value: ShaderRef) -> Self

Source

pub fn font(self, value: impl Into<Cow<'static, str>>) -> Self

Source

pub fn size(self, value: f32) -> Self

Source

pub fn text(self, value: impl Into<Cow<'static, str>>) -> Self

Source

pub fn tint(self, value: Rgba<f32>) -> Self

Source

pub fn horizontal_align(self, value: HorizontalAlign) -> Self

Source

pub fn vertical_align(self, value: VerticalAlign) -> Self

Source

pub fn width(self, value: f32) -> Self

Source

pub fn height(self, value: f32) -> Self

Source

pub fn uniform(self, key: Cow<'static, str>, value: GlowUniformValue) -> Self

Source

pub fn transform(self, value: Transform<f32, f32, f32>) -> Self

Source

pub fn position(self, value: Vec2<f32>) -> Self

Source

pub fn orientation(self, value: Quaternion<f32>) -> Self

Source

pub fn rotation(self, angle_radians: f32) -> Self

Source

pub fn scale(self, value: Vec2<f32>) -> Self

Source

pub fn blending(self, value: GlowBlending) -> Self

Source

pub fn screen_space(self, value: bool) -> Self

Trait Implementations§

Source§

impl Default for Text

Source§

fn default() -> Self

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

impl Drawable for Text

Source§

fn draw(&self, context: &mut DrawContext, graphics: &mut Graphics<Vertex>)

Auto Trait Implementations§

§

impl Freeze for Text

§

impl !RefUnwindSafe for Text

§

impl !Send for Text

§

impl !Sync for Text

§

impl Unpin for Text

§

impl !UnwindSafe for Text

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