[][src]Struct rlbot::RenderGroup

pub struct RenderGroup<'a> { /* fields omitted */ }

A render group in the process of being built.

The drawing methods in this class simply collect a list of items to be drawn later. Nothing will actually be drawn to screen until render is called.

Examples

Basic rendering

let rlbot = rlbot::init()?;
let mut group = rlbot.begin_render_group(1234);
let green = group.color_rgb(0, 255, 0);
group.draw_string_2d((10.0, 10.0), (2, 2), "I am text!", green);
group.render()?;

Clearing the screen

let rlbot = rlbot::init()?;
let group = rlbot.begin_render_group(1234);
group.render()?;

Methods

impl<'a> RenderGroup<'a>[src]

pub fn render(self) -> Result<(), Box<dyn Error>>[src]

Send the collected drawings to RLBot to be rendered to screen.

pub fn color_argb(&mut self, a: u8, r: u8, g: u8, b: u8) -> Color<'a>[src]

Create a color with the given alpha, red, green, and blue. An alpha of 255 is fully opaque, and 0 is fully transparent.

A color can only be used with the RenderGroup that created it.

Example

let transbluecent = group.color_argb(127, 0, 0, 255);

pub fn color_rgb(&mut self, r: u8, g: u8, b: u8) -> Color<'a>[src]

Create an opaque color with the given, red, green, and blue.

A color can only be used with the RenderGroup that created it.

Example

let green = group.color_rgb(0, 255, 0);

pub fn draw_line_2d(
    &mut self,
    (x1, y1): (f32, f32),
    (x2, y2): (f32, f32),
    Color: Color
)
[src]

Draw a line using screen coordinates.

Example

group.draw_line_2d((10.0, 10.0), (100.0, 100.0), green);

pub fn draw_line_3d(
    &mut self,
    (x1, y1, z1): (f32, f32, f32),
    (x2, y2, z2): (f32, f32, f32),
    Color: Color
)
[src]

Draw a line using world coordinates.

Example

group.draw_line_3d((10.0, 10.0, 10.0), (100.0, 100.0, 100.0), green);

pub fn draw_line_2d_3d(
    &mut self,
    (x1, y1): (f32, f32),
    (x2, y2, z2): (f32, f32, f32),
    Color: Color
)
[src]

Draw a line with one endpoint in screen coordinates and the other at a point projected from world coordinates to screen coordinates.

Example

group.draw_line_2d_3d((10.0, 10.0), (100.0, 100.0, 100.0), green);

pub fn draw_string_2d(
    &mut self,
    (x, y): (f32, f32),
    (scale_x, scale_y): (i32, i32),
    text: impl AsRef<str>,
    Color: Color
)
[src]

Draw text using screen coordinates.

Example

group.draw_string_2d((10.0, 10.0), (2, 2), "I am text!", green);

pub fn draw_string_3d(
    &mut self,
    (x, y, z): (f32, f32, f32),
    (scale_x, scale_y): (i32, i32),
    text: impl AsRef<str>,
    Color: Color
)
[src]

Draw text at a point projected from world coordinates to screen coordinates.

Example

group.draw_string_3d((10.0, 10.0, 10.0), (2, 2), "I am text!", green);

Auto Trait Implementations

impl<'a> !Send for RenderGroup<'a>

impl<'a> !Sync for RenderGroup<'a>

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>,