pub struct Renderer { /* private fields */ }
Implementations§
Source§impl Renderer
impl Renderer
pub fn new(font_data: Vec<u8>) -> Self
pub fn set_background_color(&mut self, r: f32, g: f32, b: f32, a: f32)
Sourcepub fn render(&mut self, screen_width: f32, screen_height: f32)
pub fn render(&mut self, screen_width: f32, screen_height: f32)
매 프레임마다 호출하여 전체 화면을 다시 그리는 메서드 (배경 지우기, 카메라/투영 매트릭스 설정 등)
Sourcepub fn text_renderer(&self) -> &TextRenderer
pub fn text_renderer(&self) -> &TextRenderer
텍스트 렌더링 객체에 접근 (폰트 그리기 등)
Sourcepub fn draw_rect(
&mut self,
x: f32,
y: f32,
width: f32,
height: f32,
color: [f32; 4],
)
pub fn draw_rect( &mut self, x: f32, y: f32, width: f32, height: f32, color: [f32; 4], )
Draws a filled rectangle at (x, y) with given width, height and color. Assumes that self.screen_width and self.screen_height are updated.
Sourcepub fn text_renderer_mut(&mut self) -> &mut TextRenderer
pub fn text_renderer_mut(&mut self) -> &mut TextRenderer
Add a new method for mutable access to the text renderer.
pub fn draw_textured_rect( &self, x: f32, y: f32, width: f32, height: f32, texture_id: u32, opacity: f32, )
pub fn draw_triangle(&mut self, vertices: [(f32, f32); 3], color: [f32; 4])
pub fn draw_circle( &mut self, center_x: f32, center_y: f32, radius: f32, color: [f32; 4], )
Auto Trait Implementations§
impl Freeze for Renderer
impl RefUnwindSafe for Renderer
impl Send for Renderer
impl Sync for Renderer
impl Unpin for Renderer
impl UnwindSafe for Renderer
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).Source§unsafe fn to_subset_unchecked(&self) -> SS
unsafe fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.