pub struct FlexText {
pub container: Container,
pub texture: Texture,
pub anchor: Vec2,
pub tint: Color,
}Expand description
Fields§
§container: ContainerScene-graph state (transform, alpha, visible, blend mode, parent / children).
texture: TextureGPU texture sampled in the fragment shader. Usually the
output of
crate::text::TextTexturePipeline::render +
crate::texture::render_texture::RenderTexture::as_texture.
anchor: Vec2Normalized anchor in [0, 1]². 0,0 = top-left, 0.5, 0.5
= centre.
tint: ColorMultiplied with the sampled texel. Defaults to white so the glyph colour baked into the source texture wins.
Implementations§
Source§impl FlexText
impl FlexText
Sourcepub fn from_texture(texture: Texture) -> Self
pub fn from_texture(texture: Texture) -> Self
Construct a FlexText from texture with default container,
top-left anchor, and white tint.
Sourcepub fn with_anchor(self, anchor: Vec2) -> Self
pub fn with_anchor(self, anchor: Vec2) -> Self
Builder: set the anchor.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FlexText
impl !RefUnwindSafe for FlexText
impl Send for FlexText
impl Sync for FlexText
impl Unpin for FlexText
impl UnsafeUnpin for FlexText
impl !UnwindSafe for FlexText
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more