pub struct TextOverlay { /* private fields */ }Expand description
A line of TextMeshPro text on its own OverlayCanvas, drawn over the game’s
UI and kept across scene loads. Positioned from the top left of the screen.
Create it on Unity’s main thread, e.g. in on_scene_loaded.
Implementations§
Source§impl TextOverlay
impl TextOverlay
pub fn new(name: &str) -> Result<Self>
pub fn game_object(&self) -> GameObject
pub fn text(&self) -> TextMeshPro
pub fn set_text(&self, text: &str) -> Result<()>
Sourcepub fn set_position(&self, x: f32, y: f32) -> Result<()>
pub fn set_position(&self, x: f32, y: f32) -> Result<()>
Pixels from the top left of the screen.
pub fn set_font_size(&self, size: f32) -> Result<()>
pub fn set_color(&self, color: Color) -> Result<()>
pub fn set_visible(&self, visible: bool) -> Result<()>
Auto Trait Implementations§
impl Forget for TextOverlay
impl Freeze for TextOverlay
impl Move for TextOverlay
impl RefUnwindSafe for TextOverlay
impl Send for TextOverlay
impl Sync for TextOverlay
impl Unpin for TextOverlay
impl UnsafeUnpin for TextOverlay
impl UnwindSafe for TextOverlay
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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