pub struct RenderContext { /* private fields */ }Expand description
Rendering context containing fonts, resolution, and configuration
Implementations§
Source§impl RenderContext
impl RenderContext
Sourcepub fn new(width: u32, height: u32) -> Self
pub fn new(width: u32, height: u32) -> Self
Create a new render context with the given dimensions
Sourcepub fn with_font_database(
width: u32,
height: u32,
font_database: FontDatabase,
) -> Self
pub fn with_font_database( width: u32, height: u32, font_database: FontDatabase, ) -> Self
Create context with custom font database
Sourcepub fn set_playback_resolution(&mut self, x: u32, y: u32)
pub fn set_playback_resolution(&mut self, x: u32, y: u32)
Set playback resolution (from script info)
Sourcepub fn set_storage_resolution(&mut self, x: u32, y: u32)
pub fn set_storage_resolution(&mut self, x: u32, y: u32)
Set storage resolution (original script resolution)
Sourcepub fn set_frame_rate(&mut self, fps: f32)
pub fn set_frame_rate(&mut self, fps: f32)
Set frame rate
Sourcepub fn set_pixel_aspect_ratio(&mut self, par: f32)
pub fn set_pixel_aspect_ratio(&mut self, par: f32)
Set pixel aspect ratio
Sourcepub fn font_database(&self) -> &FontDatabase
pub fn font_database(&self) -> &FontDatabase
Get font database
Sourcepub fn font_database_mut(&mut self) -> &mut FontDatabase
pub fn font_database_mut(&mut self) -> &mut FontDatabase
Get mutable font database
Sourcepub fn playback_res_x(&self) -> u32
pub fn playback_res_x(&self) -> u32
Get playback resolution X
Sourcepub fn playback_res_y(&self) -> u32
pub fn playback_res_y(&self) -> u32
Get playback resolution Y
Sourcepub fn storage_res_x(&self) -> u32
pub fn storage_res_x(&self) -> u32
Get storage resolution X
Sourcepub fn storage_res_y(&self) -> u32
pub fn storage_res_y(&self) -> u32
Get storage resolution Y
Sourcepub fn frame_rate(&self) -> f32
pub fn frame_rate(&self) -> f32
Get frame rate
Sourcepub fn pixel_aspect_ratio(&self) -> f32
pub fn pixel_aspect_ratio(&self) -> f32
Get pixel aspect ratio
Sourcepub fn render_scale_x(&self) -> f32
pub fn render_scale_x(&self) -> f32
Calculate X scale factor from playback to render resolution
Sourcepub fn render_scale_y(&self) -> f32
pub fn render_scale_y(&self) -> f32
Calculate Y scale factor from playback to render resolution
Trait Implementations§
Source§impl Clone for RenderContext
impl Clone for RenderContext
Source§fn clone(&self) -> RenderContext
fn clone(&self) -> RenderContext
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for RenderContext
impl !UnwindSafe for RenderContext
impl Freeze for RenderContext
impl Send for RenderContext
impl Sync for RenderContext
impl Unpin for RenderContext
impl UnsafeUnpin for RenderContext
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> 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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().