pub struct CaptionLayout {
pub background: Graphics,
pub text_sprite: Sprite,
pub text_rt: Arc<RenderTexture>,
pub height_ndc: f32,
}Expand description
Result of laying out a CaptionBlock.
background and text_sprite are positioned in local NDC:
the background is at Rect::new(0, 0, width_ndc, height_ndc) and
the text sprite is inset by padding_ndc. Attach both to a
Container and use the container’s transform to position the
caption in the scene.
Fields§
§background: GraphicsBackground pill / card.
text_sprite: SpriteText rendered into a RenderTexture, wrapped in a Sprite.
text_rt: Arc<RenderTexture>Backing render-texture (kept alive for the duration of the
caller’s stage). The sprite holds a Texture clone from this.
height_ndc: f32Computed caption height in local NDC: text_height + 2 × padding.
Auto Trait Implementations§
impl Freeze for CaptionLayout
impl !RefUnwindSafe for CaptionLayout
impl Send for CaptionLayout
impl Sync for CaptionLayout
impl Unpin for CaptionLayout
impl UnsafeUnpin for CaptionLayout
impl !UnwindSafe for CaptionLayout
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
§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