Trait raylib::core::drawing::RaylibDraw[][src]

pub trait RaylibDraw {
Show 52 methods fn clear_background(&mut self, color: impl Into<Color>) { ... }
fn set_shapes_texture(
        &mut self,
        texture: impl AsRef<Texture2D>,
        source: impl Into<Rectangle>
    ) { ... }
fn draw_pixel(&mut self, x: i32, y: i32, color: impl Into<Color>) { ... }
fn draw_pixel_v(
        &mut self,
        position: impl Into<Vector2>,
        color: impl Into<Color>
    ) { ... }
fn draw_line(
        &mut self,
        start_pos_x: i32,
        start_pos_y: i32,
        end_pos_x: i32,
        end_pos_y: i32,
        color: impl Into<Color>
    ) { ... }
fn draw_line_v(
        &mut self,
        start_pos: impl Into<Vector2>,
        end_pos: impl Into<Vector2>,
        color: impl Into<Color>
    ) { ... }
fn draw_line_ex(
        &mut self,
        start_pos: impl Into<Vector2>,
        end_pos: impl Into<Vector2>,
        thick: f32,
        color: impl Into<Color>
    ) { ... }
fn draw_line_bezier(
        &mut self,
        start_pos: impl Into<Vector2>,
        end_pos: impl Into<Vector2>,
        thick: f32,
        color: impl Into<Color>
    ) { ... }
fn draw_line_bezier_quad(
        &mut self,
        start_pos: impl Into<Vector2>,
        end_pos: impl Into<Vector2>,
        control_pos: impl Into<Vector2>,
        thick: f32,
        color: impl Into<Color>
    ) { ... }
fn draw_line_strip(&mut self, points: &[Vector2], color: impl Into<Color>) { ... }
fn draw_circle(
        &mut self,
        center_x: i32,
        center_y: i32,
        radius: f32,
        color: impl Into<Color>
    ) { ... }
fn draw_circle_sector(
        &mut self,
        center: impl Into<Vector2>,
        radius: f32,
        start_angle: f32,
        end_angle: f32,
        segments: i32,
        color: impl Into<Color>
    ) { ... }
fn draw_circle_sector_lines(
        &mut self,
        center: impl Into<Vector2>,
        radius: f32,
        start_angle: f32,
        end_angle: f32,
        segments: i32,
        color: impl Into<Color>
    ) { ... }
fn draw_circle_gradient(
        &mut self,
        center_x: i32,
        center_y: i32,
        radius: f32,
        color1: impl Into<Color>,
        color2: impl Into<Color>
    ) { ... }
fn draw_circle_v(
        &mut self,
        center: impl Into<Vector2>,
        radius: f32,
        color: impl Into<Color>
    ) { ... }
fn draw_circle_lines(
        &mut self,
        center_x: i32,
        center_y: i32,
        radius: f32,
        color: impl Into<Color>
    ) { ... }
fn draw_ellipse(
        &mut self,
        center_x: i32,
        center_y: i32,
        radius_h: f32,
        radius_v: f32,
        color: impl Into<Color>
    ) { ... }
fn draw_ellipse_lines(
        &mut self,
        center_x: i32,
        center_y: i32,
        radius_h: f32,
        radius_v: f32,
        color: impl Into<Color>
    ) { ... }
fn draw_ring(
        &mut self,
        center: impl Into<Vector2>,
        inner_radius: f32,
        outer_radius: f32,
        start_angle: f32,
        end_angle: f32,
        segments: i32,
        color: impl Into<Color>
    ) { ... }
fn draw_ring_lines(
        &mut self,
        center: impl Into<Vector2>,
        inner_radius: f32,
        outer_radius: f32,
        start_angle: f32,
        end_angle: f32,
        segments: i32,
        color: impl Into<Color>
    ) { ... }
fn draw_rectangle(
        &mut self,
        x: i32,
        y: i32,
        width: i32,
        height: i32,
        color: impl Into<Color>
    ) { ... }
fn draw_rectangle_v(
        &mut self,
        position: impl Into<Vector2>,
        size: impl Into<Vector2>,
        color: impl Into<Color>
    ) { ... }
fn draw_rectangle_rec(
        &mut self,
        rec: impl Into<Rectangle>,
        color: impl Into<Color>
    ) { ... }
fn draw_rectangle_pro(
        &mut self,
        rec: impl Into<Rectangle>,
        origin: impl Into<Vector2>,
        rotation: f32,
        color: impl Into<Color>
    ) { ... }
fn draw_rectangle_gradient_v(
        &mut self,
        x: i32,
        y: i32,
        width: i32,
        height: i32,
        color1: impl Into<Color>,
        color2: impl Into<Color>
    ) { ... }
fn draw_rectangle_gradient_h(
        &mut self,
        x: i32,
        y: i32,
        width: i32,
        height: i32,
        color1: impl Into<Color>,
        color2: impl Into<Color>
    ) { ... }
fn draw_rectangle_gradient_ex(
        &mut self,
        rec: impl Into<Rectangle>,
        col1: impl Into<Color>,
        col2: impl Into<Color>,
        col3: impl Into<Color>,
        col4: impl Into<Color>
    ) { ... }
fn draw_rectangle_lines(
        &mut self,
        x: i32,
        y: i32,
        width: i32,
        height: i32,
        color: impl Into<Color>
    ) { ... }
fn draw_rectangle_lines_ex(
        &mut self,
        rec: impl Into<Rectangle>,
        line_thick: i32,
        color: impl Into<Color>
    ) { ... }
fn draw_rectangle_rounded(
        &mut self,
        rec: impl Into<Rectangle>,
        roundness: f32,
        segments: i32,
        color: impl Into<Color>
    ) { ... }
fn draw_rectangle_rounded_lines(
        &mut self,
        rec: impl Into<Rectangle>,
        roundness: f32,
        segments: i32,
        line_thickness: i32,
        color: impl Into<Color>
    ) { ... }
fn draw_triangle(
        &mut self,
        v1: impl Into<Vector2>,
        v2: impl Into<Vector2>,
        v3: impl Into<Vector2>,
        color: impl Into<Color>
    ) { ... }
fn draw_triangle_lines(
        &mut self,
        v1: impl Into<Vector2>,
        v2: impl Into<Vector2>,
        v3: impl Into<Vector2>,
        color: impl Into<Color>
    ) { ... }
fn draw_triangle_fan(&mut self, points: &[Vector2], color: impl Into<Color>) { ... }
fn draw_triangle_strip(
        &mut self,
        points: &[Vector2],
        color: impl Into<Color>
    ) { ... }
fn draw_poly(
        &mut self,
        center: impl Into<Vector2>,
        sides: i32,
        radius: f32,
        rotation: f32,
        color: impl Into<Color>
    ) { ... }
fn draw_poly_lines(
        &mut self,
        center: impl Into<Vector2>,
        sides: i32,
        radius: f32,
        rotation: f32,
        color: impl Into<Color>
    ) { ... }
fn draw_texture(
        &mut self,
        texture: impl AsRef<Texture2D>,
        x: i32,
        y: i32,
        tint: impl Into<Color>
    ) { ... }
fn draw_texture_v(
        &mut self,
        texture: impl AsRef<Texture2D>,
        position: impl Into<Vector2>,
        tint: impl Into<Color>
    ) { ... }
fn draw_texture_ex(
        &mut self,
        texture: impl AsRef<Texture2D>,
        position: impl Into<Vector2>,
        rotation: f32,
        scale: f32,
        tint: impl Into<Color>
    ) { ... }
fn draw_texture_rec(
        &mut self,
        texture: impl AsRef<Texture2D>,
        source_rec: impl Into<Rectangle>,
        position: impl Into<Vector2>,
        tint: impl Into<Color>
    ) { ... }
fn draw_texture_quad(
        &mut self,
        texture: impl AsRef<Texture2D>,
        tiling: impl Into<Vector2>,
        offset: impl Into<Vector2>,
        quad: impl Into<Rectangle>,
        tint: impl Into<Color>
    ) { ... }
fn draw_texture_pro(
        &mut self,
        texture: impl AsRef<Texture2D>,
        source_rec: impl Into<Rectangle>,
        dest_rec: impl Into<Rectangle>,
        origin: impl Into<Vector2>,
        rotation: f32,
        tint: impl Into<Color>
    ) { ... }
fn draw_texture_tiled(
        &mut self,
        texture: impl AsRef<Texture2D>,
        source_rec: impl Into<Rectangle>,
        dest_rec: impl Into<Rectangle>,
        origin: impl Into<Vector2>,
        rotation: f32,
        scale: f32,
        tint: impl Into<Color>
    ) { ... }
fn draw_texture_n_patch(
        &mut self,
        texture: impl AsRef<Texture2D>,
        n_patch_info: impl Into<NPatchInfo>,
        dest_rec: impl Into<Rectangle>,
        origin: impl Into<Vector2>,
        rotation: f32,
        tint: impl Into<Color>
    ) { ... }
fn draw_texture_poly(
        &mut self,
        texture: impl AsRef<Texture2D>,
        center: impl Into<Vector2>,
        points: &[Vector2],
        texcoords: &[Vector2],
        tint: impl Into<Color>
    ) { ... }
fn draw_fps(&mut self, x: i32, y: i32) { ... }
fn draw_text(
        &mut self,
        text: &str,
        x: i32,
        y: i32,
        font_size: i32,
        color: impl Into<Color>
    ) { ... }
fn draw_text_ex(
        &mut self,
        font: impl AsRef<Font>,
        text: &str,
        position: impl Into<Vector2>,
        font_size: f32,
        spacing: f32,
        tint: impl Into<Color>
    ) { ... }
fn draw_text_rec(
        &mut self,
        font: impl AsRef<Font>,
        text: &str,
        rec: impl Into<Rectangle>,
        font_size: f32,
        spacing: f32,
        word_wrap: bool,
        tint: impl Into<Color>
    ) { ... }
fn draw_text_rec_ex(
        &mut self,
        font: impl AsRef<Font>,
        text: &str,
        rec: impl Into<Rectangle>,
        font_size: f32,
        spacing: f32,
        word_wrap: bool,
        tint: impl Into<Color>,
        select_start: i32,
        select_length: i32,
        select_text: impl Into<Color>,
        select_back: impl Into<Color>
    ) { ... }
fn draw_text_codepoint(
        &mut self,
        font: impl AsRef<Font>,
        codepoint: i32,
        position: impl Into<Vector2>,
        scale: f32,
        tint: impl Into<Color>
    ) { ... }
}

Provided methods

Sets background color (framebuffer clear color).

Define default texture used to draw shapes

Draws a pixel.

Draws a pixel (Vector version).

Draws a line.

Draws a line (Vector version).

Draws a line with thickness.

Draws a line using cubic-bezier curves in-out.

Draw line using quadratic bezier curves with a control point

Draw lines sequence

Draws a color-filled circle.

Draw a piece of a circle

Draw circle sector outline

Draws a gradient-filled circle.

Draws a color-filled circle (Vector version).

Draws circle outline.

Draws ellipse.

Draws ellipse.

Draw ring

Draw ring lines

Draws a color-filled rectangle.

Draws a color-filled rectangle (Vector version).

Draws a color-filled rectangle from rec.

Draws a color-filled rectangle with pro parameters.

Draws a vertical-gradient-filled rectangle.

NOTE: Gradient goes from bottom (color1) to top (color2).

Draws a horizontal-gradient-filled rectangle.

NOTE: Gradient goes from bottom (color1) to top (color2).

Draws a gradient-filled rectangle with custom vertex colors.

NOTE: Colors refer to corners, starting at top-left corner and going counter-clockwise.

Draws rectangle outline.

Draws rectangle outline with extended parameters.

Draws rectangle outline with extended parameters.

Draws rectangle outline with extended parameters.

Draws a triangle.

Draws a triangle using lines.

Draw a triangle fan defined by points.

Draw a triangle strip defined by points

Draws a regular polygon of n sides (Vector version).

Draws a regular polygon of n sides (Vector version).

Draws a texture using specified position and tint color.

Draws a texture using specified position vector and tint color.

Draws a texture with extended parameters.

Draws from a region of texture defined by the source_rec rectangle.

Draw texture quad with tiling and offset parameters

Draw from a region of texture defined by the source_rec rectangle with pro parameters.

Draw part of a texture (defined by a rectangle) with rotation and scale tiled into dest.

Draws a texture (or part of it) that stretches or shrinks nicely

Draws a texture (or part of it) that stretches or shrinks nicely

Shows current FPS.

Draws text (using default font).

Draws text using font and additional parameters.

Draws text using font and additional parameters.

Draws text using font and additional parameters.

Draw one character (codepoint)

Implementors