pub struct Director {}Expand description
A struct manages the game scene trees and provides access to root scene nodes for different game uses.
Implementations§
Source§impl Director
impl Director
Sourcepub fn set_clear_color(val: &Color)
pub fn set_clear_color(val: &Color)
Sets the background color for the game world.
Sourcepub fn get_clear_color() -> Color
pub fn get_clear_color() -> Color
Gets the background color for the game world.
Sourcepub fn get_ui() -> Node
pub fn get_ui() -> Node
Gets the root node for 2D user interface elements like buttons and labels.
Sourcepub fn get_ui_3d() -> Node
pub fn get_ui_3d() -> Node
Gets the root node for 3D user interface elements with 3D projection effect.
Sourcepub fn get_post_node() -> Node
pub fn get_post_node() -> Node
Gets the root node for post-rendering scene tree.
Sourcepub fn get_current_camera() -> Camera
pub fn get_current_camera() -> Camera
Gets the current active camera in Director’s camera stack.
Sourcepub fn set_frustum_culling(val: bool)
pub fn set_frustum_culling(val: bool)
Sets whether or not to enable frustum culling.
Sourcepub fn is_frustum_culling() -> bool
pub fn is_frustum_culling() -> bool
Gets whether or not to enable frustum culling.
Sourcepub fn schedule(update_func: Box<dyn FnMut(f64) -> bool>)
pub fn schedule(update_func: Box<dyn FnMut(f64) -> bool>)
Schedule a function to be called every frame.
§Arguments
updateFunc- The function to call every frame.
Sourcepub fn schedule_posted(update_func: Box<dyn FnMut(f64) -> bool>)
pub fn schedule_posted(update_func: Box<dyn FnMut(f64) -> bool>)
Schedule a function to be called every frame for processing post game logic.
§Arguments
func- The function to call every frame.
Sourcepub fn push_camera(camera: &dyn ICamera)
pub fn push_camera(camera: &dyn ICamera)
Adds a new camera to Director’s camera stack and sets it to the current camera.
§Arguments
camera- The camera to add.
Sourcepub fn pop_camera()
pub fn pop_camera()
Removes the current camera from Director’s camera stack.
Sourcepub fn remove_camera(camera: &dyn ICamera) -> bool
pub fn remove_camera(camera: &dyn ICamera) -> bool
Sourcepub fn clear_camera()
pub fn clear_camera()
Removes all cameras from Director’s camera stack.
Source§impl Director
impl Director
Sourcepub fn get_scheduler() -> Scheduler
pub fn get_scheduler() -> Scheduler
Gets the scheduler for the director. The scheduler is used for scheduling tasks to run for the main game logic.
§Returns
Scheduler- The scheduler for the director.
Sourcepub fn get_post_scheduler() -> Scheduler
pub fn get_post_scheduler() -> Scheduler
Gets the post scheduler for the director. The post scheduler is used for scheduling tasks that should run after the main scheduler has finished.
§Returns
Scheduler- The post scheduler for the director.