pub struct Title {
pub transform: Matrix,
pub text: String,
pub text_style: Option<TextStyle>,
/* private fields */
}
Expand description
Title is a basic Stepper to show a big title in the scene.
§Fields that can be changed before initialization:
transform
- The transform of the text. Default is [0.0, 1.0, -0.5] * Y_180°text
- The text to display. Default is “Title”.text_style
- The style of the text. Default is a white text with a size of 0.5 and the default font.
§Events this stepper is listening to:
None, This stepper does not listen to any event.
§Examples
use stereokit_rust::{tools::title::Title, util::named_colors, maths::Matrix};
let mut title = Title::new("My Title", Some(named_colors::RED), None, None);
title.transform = Matrix::t_r([-0.2, 0.0, -0.3], [0.0, 160.0, 0.0]);
sk.send_event(StepperAction::add("Title", title));
filename_scr = "screenshots/title.jpeg";
test_screenshot!( // !!!! Get a proper main loop !!!!
);

Fields§
§transform: Matrix
§text: String
§text_style: Option<TextStyle>
Implementations§
Source§impl Title
All the code here run in the main thread
impl Title
All the code here run in the main thread
Sourcepub fn new(
text: &str,
color: Option<Color32>,
font_size: Option<f32>,
font: Option<Font>,
) -> Self
pub fn new( text: &str, color: Option<Color32>, font_size: Option<f32>, font: Option<Font>, ) -> Self
Create a new Title stepper
text
- The text to displaycolor
- The color of the text. Default is WHITEfont_size
- The size of the font. Default is 0.5font
- The font to use. Default is the default font
Trait Implementations§
Source§impl Default for Title
impl Default for Title
Source§fn default() -> Self
fn default() -> Self
This code may be called in some threads, so no StereoKit code. It’s better to use Title::new instead as you need to set the text.
Source§impl IStepper for Title
impl IStepper for Title
Source§fn initialize(&mut self, id: StepperId, sk_info: Rc<RefCell<SkInfo>>) -> bool
fn initialize(&mut self, id: StepperId, sk_info: Rc<RefCell<SkInfo>>) -> bool
This is called by StereoKit at the start of the next frame, and on the main thread. This happens before
StereoKit’s main Step callback, and always after Sk.initialize.
https://stereokit.net/Pages/StereoKit.Framework/IStepper/Initialize.html
id : The id of the stepper
sk : The SkInfo of the runnin Sk instance. Read more
Source§fn step(&mut self, token: &MainThreadToken)
fn step(&mut self, token: &MainThreadToken)
This Step method will be called every frame of the application, as long as Enabled is true. This happens
immediately before the main application’s Step callback.
https://stereokit.net/Pages/StereoKit.Framework/IStepper/Step.html
Source§fn initialize_done(&mut self) -> bool
fn initialize_done(&mut self) -> bool
If initialization is to be performed in multiple steps, with or without threads and in order to avoid black or
frozen screens, write the on going initialization here Read more
Source§fn enabled(&self) -> bool
fn enabled(&self) -> bool
Is this IStepper enabled? When false, StereoKit will not call Step. This can be a good way to temporarily
disable the IStepper without removing or shutting it down.
https://stereokit.net/Pages/StereoKit.Framework/IStepper/Enabled.html
Source§fn shutdown(&mut self)
fn shutdown(&mut self)
This is called when the IStepper is removed, or the application shuts down. This is always called on the main
thread, and happens at the start of the next frame, before the main application’s Step callback.
https://stereokit.net/Pages/StereoKit.Framework/IStepper/Shutdown.html
Source§fn shutdown_done(&mut self) -> bool
fn shutdown_done(&mut self) -> bool
If shutdown is to be performed in multiple steps, with or without threads and in order to avoid black or
frozen screens, write the on going shutdown here Read more
impl Send for Title
Auto Trait Implementations§
impl Freeze for Title
impl !RefUnwindSafe for Title
impl !Sync for Title
impl Unpin for Title
impl !UnwindSafe for Title
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,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.