SceneItemTrait

Trait SceneItemTrait 

Source
pub trait SceneItemTrait:
    Debug
    + Send
    + Sync {
    // Required methods
    fn as_ptr(&self) -> &SmartPointerSendable<*mut obs_scene_item>;
    fn runtime(&self) -> ObsRuntime;
    fn inner_source_dyn(&self) -> &dyn ObsSourceTrait;
    fn inner_source_dyn_mut(&mut self) -> &mut dyn ObsSourceTrait;

    // Provided methods
    fn get_transform_info(&self) -> Result<ObsTransformInfo, ObsError> { ... }
    fn get_source_position(&self) -> Result<Vec2, ObsError> { ... }
    fn get_source_scale(&self) -> Result<Vec2, ObsError> { ... }
    fn set_source_position(&self, position: Vec2) -> Result<(), ObsError> { ... }
    fn set_transform_info(
        &self,
        info: &ObsTransformInfo,
    ) -> Result<(), ObsError> { ... }
    fn fit_source_to_screen(&self) -> Result<bool, ObsError> { ... }
    fn set_source_scale(&self, scale: Vec2) -> Result<(), ObsError> { ... }
}

Required Methods§

Source

fn as_ptr(&self) -> &SmartPointerSendable<*mut obs_scene_item>

Source

fn runtime(&self) -> ObsRuntime

Source

fn inner_source_dyn(&self) -> &dyn ObsSourceTrait

Source

fn inner_source_dyn_mut(&mut self) -> &mut dyn ObsSourceTrait

Provided Methods§

Source

fn get_transform_info(&self) -> Result<ObsTransformInfo, ObsError>

Gets the transform info of the given source in this scene.

Source

fn get_source_position(&self) -> Result<Vec2, ObsError>

Gets the position of the given source in this scene.

Source

fn get_source_scale(&self) -> Result<Vec2, ObsError>

Gets the scale of the given source in this scene.

Source

fn set_source_position(&self, position: Vec2) -> Result<(), ObsError>

Sets the position of the given source in this scene.

Source

fn set_transform_info(&self, info: &ObsTransformInfo) -> Result<(), ObsError>

Sets the transform info of the given source in this scene. The ObsTransformInfo can be built by using the ObsTransformInfoBuilder.

Source

fn fit_source_to_screen(&self) -> Result<bool, ObsError>

Fits the given source to the screen size. If the source is locked, no action is taken.

Returns Ok(true) if the source was resized, Ok(false) if the source was locked and not resized.

Source

fn set_source_scale(&self, scale: Vec2) -> Result<(), ObsError>

Sets the scale of the given source in this scene.

Implementors§