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 Freeze 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