pub trait RaylibDraw {
Show 70 methods
// Provided methods
fn clear_background(&mut self, color: impl Into<Color>) { ... }
fn get_shapes_texture(&self) -> Texture2D { ... }
fn get_shapes_texture_rectangle(&self) -> Rectangle { ... }
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_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_circle_lines_v(
&mut self,
center: impl Into<Vector2>,
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: f32,
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,
color: impl Into<Color>,
) { ... }
fn draw_rectangle_rounded_lines_ex(
&mut self,
rec: impl Into<Rectangle>,
roundness: f32,
segments: i32,
line_thickness: f32,
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_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_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_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_codepoints(
&mut self,
font: impl AsRef<Font>,
text: &str,
position: Vector2,
font_size: f32,
spacing: f32,
tint: 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_pro(
&mut self,
font: impl AsRef<Font>,
text: &str,
position: impl Into<Vector2>,
origin: impl Into<Vector2>,
rotation: f32,
font_size: f32,
spacing: f32,
tint: 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>,
) { ... }
fn enable_event_waiting(&self) { ... }
fn disable_event_waiting(&self) { ... }
fn draw_poly_lines_ex(
&mut self,
center: Vector2,
sides: i32,
radius: f32,
rotation: f32,
line_thick: f32,
color: impl Into<Color>,
) { ... }
fn draw_spline_linear(
&mut self,
points: &[Vector2],
thick: f32,
color: impl Into<Color>,
) { ... }
fn draw_spline_basis(
&mut self,
points: &[Vector2],
thick: f32,
color: impl Into<Color>,
) { ... }
fn draw_spline_catmull_rom(
&mut self,
points: &[Vector2],
thick: f32,
color: impl Into<Color>,
) { ... }
fn draw_spline_bezier_quadratic(
&mut self,
points: &[Vector2],
thick: f32,
color: impl Into<Color>,
) { ... }
fn draw_spline_bezier_cubic(
&mut self,
points: &[Vector2],
thick: f32,
color: impl Into<Color>,
) { ... }
fn draw_spline_segment_linear(
&mut self,
p1: Vector2,
p2: Vector2,
thick: f32,
color: impl Into<Color>,
) { ... }
fn draw_spline_segment_basis(
&mut self,
p1: Vector2,
p2: Vector2,
p3: Vector2,
p4: Vector2,
thick: f32,
color: impl Into<Color>,
) { ... }
fn draw_spline_segment_catmull_rom(
&mut self,
p1: Vector2,
p2: Vector2,
p3: Vector2,
p4: Vector2,
thick: f32,
color: impl Into<Color>,
) { ... }
fn draw_spline_segment_bezier_quadratic(
&mut self,
p1: Vector2,
c2: Vector2,
p3: Vector2,
thick: f32,
color: impl Into<Color>,
) { ... }
fn draw_spline_segment_bezier_cubic(
&mut self,
p1: Vector2,
c2: Vector2,
c3: Vector2,
p4: Vector2,
thick: f32,
color: impl Into<Color>,
) { ... }
fn get_spline_point_linear(
&mut self,
start_pos: Vector2,
end_pos: Vector2,
t: f32,
) -> Vector2 { ... }
fn get_spline_point_basis(
&mut self,
p1: Vector2,
p2: Vector2,
p3: Vector2,
p4: Vector2,
t: f32,
) -> Vector2 { ... }
fn get_spline_point_catmull_rom(
&mut self,
p1: Vector2,
p2: Vector2,
p3: Vector2,
p4: Vector2,
t: f32,
) -> Vector2 { ... }
fn get_spline_point_bezier_quad(
&mut self,
p1: Vector2,
c2: Vector2,
p3: Vector2,
t: f32,
) -> Vector2 { ... }
fn get_spline_point_bezier_cubic(
&mut self,
p1: Vector2,
c2: Vector2,
c3: Vector2,
p4: Vector2,
t: f32,
) -> Vector2 { ... }
}
Provided Methods§
Sourcefn clear_background(&mut self, color: impl Into<Color>)
fn clear_background(&mut self, color: impl Into<Color>)
Sets background color (framebuffer clear color.into()).
Sourcefn get_shapes_texture(&self) -> Texture2D
fn get_shapes_texture(&self) -> Texture2D
Get texture that is used for shapes drawing
Sourcefn get_shapes_texture_rectangle(&self) -> Rectangle
fn get_shapes_texture_rectangle(&self) -> Rectangle
Get texture source rectangle that is used for shapes drawing
Sourcefn set_shapes_texture(
&mut self,
texture: impl AsRef<Texture2D>,
source: impl Into<Rectangle>,
)
fn set_shapes_texture( &mut self, texture: impl AsRef<Texture2D>, source: impl Into<Rectangle>, )
Define default texture used to draw shapes
Sourcefn draw_pixel_v(
&mut self,
position: impl Into<Vector2>,
color: impl Into<Color>,
)
fn draw_pixel_v( &mut self, position: impl Into<Vector2>, color: impl Into<Color>, )
Draws a pixel (Vector version).
Sourcefn 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( &mut self, start_pos_x: i32, start_pos_y: i32, end_pos_x: i32, end_pos_y: i32, color: impl Into<Color>, )
Draws a line.
Sourcefn draw_line_v(
&mut self,
start_pos: impl Into<Vector2>,
end_pos: impl Into<Vector2>,
color: impl Into<Color>,
)
fn draw_line_v( &mut self, start_pos: impl Into<Vector2>, end_pos: impl Into<Vector2>, color: impl Into<Color>, )
Draws a line (Vector version).
Sourcefn draw_line_ex(
&mut self,
start_pos: impl Into<Vector2>,
end_pos: impl Into<Vector2>,
thick: f32,
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>, )
Draws a line with thickness.
Sourcefn 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( &mut self, start_pos: impl Into<Vector2>, end_pos: impl Into<Vector2>, thick: f32, color: impl Into<Color>, )
Draws a line using cubic-bezier curves in-out.
Sourcefn draw_line_strip(&mut self, points: &[Vector2], color: impl Into<Color>)
fn draw_line_strip(&mut self, points: &[Vector2], color: impl Into<Color>)
Draw lines sequence #[inline]
Sourcefn draw_circle(
&mut self,
center_x: i32,
center_y: i32,
radius: f32,
color: impl Into<Color>,
)
fn draw_circle( &mut self, center_x: i32, center_y: i32, radius: f32, color: impl Into<Color>, )
Draws a color-filled circle.
Sourcefn 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( &mut self, center: impl Into<Vector2>, radius: f32, start_angle: f32, end_angle: f32, segments: i32, color: impl Into<Color>, )
Draw a piece of a circle
Sourcefn 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_sector_lines( &mut self, center: impl Into<Vector2>, radius: f32, start_angle: f32, end_angle: f32, segments: i32, color: impl Into<Color>, )
Draw circle sector outline
Sourcefn draw_circle_gradient(
&mut self,
center_x: i32,
center_y: i32,
radius: f32,
color1: impl Into<Color>,
color2: 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>, )
Draws a gradient-filled circle.
Sourcefn draw_circle_v(
&mut self,
center: impl Into<Vector2>,
radius: f32,
color: impl Into<Color>,
)
fn draw_circle_v( &mut self, center: impl Into<Vector2>, radius: f32, color: impl Into<Color>, )
Draws a color-filled circle (Vector version).
Sourcefn draw_circle_lines(
&mut self,
center_x: i32,
center_y: i32,
radius: f32,
color: impl Into<Color>,
)
fn draw_circle_lines( &mut self, center_x: i32, center_y: i32, radius: f32, color: impl Into<Color>, )
Draws circle outline.
Sourcefn draw_circle_lines_v(
&mut self,
center: impl Into<Vector2>,
radius: f32,
color: impl Into<Color>,
)
fn draw_circle_lines_v( &mut self, center: impl Into<Vector2>, radius: f32, color: impl Into<Color>, )
Draws circle outline. (Vector Version)
Sourcefn draw_ellipse(
&mut self,
center_x: i32,
center_y: i32,
radius_h: f32,
radius_v: 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>, )
Draws ellipse.
Sourcefn draw_ellipse_lines(
&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>, )
Draws ellipse.
Sourcefn 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( &mut self, center: impl Into<Vector2>, inner_radius: f32, outer_radius: f32, start_angle: f32, end_angle: f32, segments: i32, color: impl Into<Color>, )
Draw ring
Sourcefn 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_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>, )
Draw ring lines
Sourcefn draw_rectangle(
&mut self,
x: i32,
y: i32,
width: i32,
height: i32,
color: impl Into<Color>,
)
fn draw_rectangle( &mut self, x: i32, y: i32, width: i32, height: i32, color: impl Into<Color>, )
Draws a color-filled rectangle.
Sourcefn draw_rectangle_v(
&mut self,
position: impl Into<Vector2>,
size: impl Into<Vector2>,
color: impl Into<Color>,
)
fn draw_rectangle_v( &mut self, position: impl Into<Vector2>, size: impl Into<Vector2>, color: impl Into<Color>, )
Draws a color-filled rectangle (Vector version).
Sourcefn draw_rectangle_rec(
&mut self,
rec: impl Into<Rectangle>,
color: impl Into<Color>,
)
fn draw_rectangle_rec( &mut self, rec: impl Into<Rectangle>, color: impl Into<Color>, )
Draws a color-filled rectangle from rec
.
Sourcefn draw_rectangle_pro(
&mut self,
rec: impl Into<Rectangle>,
origin: impl Into<Vector2>,
rotation: f32,
color: impl Into<Color>,
)
fn draw_rectangle_pro( &mut self, rec: impl Into<Rectangle>, origin: impl Into<Vector2>, rotation: f32, color: impl Into<Color>, )
Draws a color-filled rectangle with pro parameters.
Sourcefn 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_v( &mut self, x: i32, y: i32, width: i32, height: i32, color1: impl Into<Color>, color2: impl Into<Color>, )
Draws a vertical-gradient-filled rectangle.
NOTE: Gradient goes from bottom (color1
) to top (color2
).
Sourcefn 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_h( &mut self, x: i32, y: i32, width: i32, height: i32, color1: impl Into<Color>, color2: impl Into<Color>, )
Draws a horizontal-gradient-filled rectangle.
NOTE: Gradient goes from bottom (color1
) to top (color2
).
Sourcefn 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_gradient_ex( &mut self, rec: impl Into<Rectangle>, col1: impl Into<Color>, col2: impl Into<Color>, col3: impl Into<Color>, col4: impl Into<Color>, )
Draws a gradient-filled rectangle with custom vertex colors.
NOTE: Colors refer to corners, starting at top-left corner and going counter-clockwise.
Sourcefn draw_rectangle_lines(
&mut self,
x: i32,
y: i32,
width: i32,
height: i32,
color: impl Into<Color>,
)
fn draw_rectangle_lines( &mut self, x: i32, y: i32, width: i32, height: i32, color: impl Into<Color>, )
Draws rectangle outline.
Sourcefn draw_rectangle_lines_ex(
&mut self,
rec: impl Into<Rectangle>,
line_thick: f32,
color: impl Into<Color>,
)
fn draw_rectangle_lines_ex( &mut self, rec: impl Into<Rectangle>, line_thick: f32, color: impl Into<Color>, )
Draws rectangle outline with extended parameters.
Sourcefn draw_rectangle_rounded(
&mut self,
rec: impl Into<Rectangle>,
roundness: f32,
segments: i32,
color: impl Into<Color>,
)
fn draw_rectangle_rounded( &mut self, rec: impl Into<Rectangle>, roundness: f32, segments: i32, color: impl Into<Color>, )
Draws rectangle with rounded edges.
Sourcefn draw_rectangle_rounded_lines(
&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, color: impl Into<Color>, )
Draws rectangle outline with rounded edges included.
Sourcefn draw_rectangle_rounded_lines_ex(
&mut self,
rec: impl Into<Rectangle>,
roundness: f32,
segments: i32,
line_thickness: f32,
color: impl Into<Color>,
)
fn draw_rectangle_rounded_lines_ex( &mut self, rec: impl Into<Rectangle>, roundness: f32, segments: i32, line_thickness: f32, color: impl Into<Color>, )
Draw rectangle with rounded edges outline
Sourcefn draw_triangle(
&mut self,
v1: impl Into<Vector2>,
v2: impl Into<Vector2>,
v3: impl Into<Vector2>,
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>, )
Draws a triangle.
Sourcefn draw_triangle_lines(
&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>, )
Draws a triangle using lines.
Sourcefn draw_triangle_fan(&mut self, points: &[Vector2], color: impl Into<Color>)
fn draw_triangle_fan(&mut self, points: &[Vector2], color: impl Into<Color>)
Draw a triangle fan defined by points.
Sourcefn draw_triangle_strip(&mut self, points: &[Vector2], color: impl Into<Color>)
fn draw_triangle_strip(&mut self, points: &[Vector2], color: impl Into<Color>)
Draw a triangle strip defined by points
Sourcefn draw_poly(
&mut self,
center: impl Into<Vector2>,
sides: i32,
radius: f32,
rotation: f32,
color: impl Into<Color>,
)
fn draw_poly( &mut self, center: impl Into<Vector2>, sides: i32, radius: f32, rotation: f32, color: impl Into<Color>, )
Draws a regular polygon of n sides (Vector version).
Sourcefn draw_poly_lines(
&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>, )
Draws a regular polygon of n sides (Vector version).
Sourcefn draw_texture(
&mut self,
texture: impl AsRef<Texture2D>,
x: i32,
y: i32,
tint: impl Into<Color>,
)
fn draw_texture( &mut self, texture: impl AsRef<Texture2D>, x: i32, y: i32, tint: impl Into<Color>, )
Draws a texture
using specified position and tint
color.
Sourcefn draw_texture_v(
&mut self,
texture: impl AsRef<Texture2D>,
position: impl Into<Vector2>,
tint: impl Into<Color>,
)
fn draw_texture_v( &mut self, texture: impl AsRef<Texture2D>, position: impl Into<Vector2>, tint: impl Into<Color>, )
Draws a texture
using specified position
vector and tint
color.
Sourcefn draw_texture_ex(
&mut self,
texture: impl AsRef<Texture2D>,
position: impl Into<Vector2>,
rotation: f32,
scale: f32,
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>, )
Draws a texture
with extended parameters.
Sourcefn 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_rec( &mut self, texture: impl AsRef<Texture2D>, source_rec: impl Into<Rectangle>, position: impl Into<Vector2>, tint: impl Into<Color>, )
Draws from a region of texture
defined by the source_rec
rectangle.
Sourcefn 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_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>, )
Draw from a region of texture
defined by the source_rec
rectangle with pro parameters.
Sourcefn 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_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>, )
Draws a texture (or part of it) that stretches or shrinks nicely
Sourcefn draw_text(
&mut self,
text: &str,
x: i32,
y: i32,
font_size: i32,
color: impl Into<Color>,
)
fn draw_text( &mut self, text: &str, x: i32, y: i32, font_size: i32, color: impl Into<Color>, )
Draws text (using default font).
This does not support UTF-8. Use [RaylibDrawHandle::draw_text_codepoints]
for that.
Sourcefn draw_text_codepoints(
&mut self,
font: impl AsRef<Font>,
text: &str,
position: Vector2,
font_size: f32,
spacing: f32,
tint: impl Into<Color>,
)
fn draw_text_codepoints( &mut self, font: impl AsRef<Font>, text: &str, position: Vector2, font_size: f32, spacing: f32, tint: impl Into<Color>, )
Draws text (using default font) with support for UTF-8.
If you do not need UTF-8, use [RaylibDrawHandle::draw_text]
.
Sourcefn 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_ex( &mut self, font: impl AsRef<Font>, text: &str, position: impl Into<Vector2>, font_size: f32, spacing: f32, tint: impl Into<Color>, )
Draws text using font
and additional parameters.
fn draw_text_pro( &mut self, font: impl AsRef<Font>, text: &str, position: impl Into<Vector2>, origin: impl Into<Vector2>, rotation: f32, font_size: f32, spacing: f32, tint: impl Into<Color>, )
Sourcefn draw_text_codepoint(
&mut self,
font: impl AsRef<Font>,
codepoint: i32,
position: impl Into<Vector2>,
scale: f32,
tint: 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>, )
Draw one character (codepoint)
Sourcefn enable_event_waiting(&self)
fn enable_event_waiting(&self)
Enable waiting for events when the handle is dropped, no automatic event polling
Sourcefn disable_event_waiting(&self)
fn disable_event_waiting(&self)
Disable waiting for events when the handle is dropped, no automatic event polling
Sourcefn draw_poly_lines_ex(
&mut self,
center: Vector2,
sides: i32,
radius: f32,
rotation: f32,
line_thick: f32,
color: impl Into<Color>,
)
fn draw_poly_lines_ex( &mut self, center: Vector2, sides: i32, radius: f32, rotation: f32, line_thick: f32, color: impl Into<Color>, )
Draw a polygon outline of n sides with extended parameters
Sourcefn draw_spline_linear(
&mut self,
points: &[Vector2],
thick: f32,
color: impl Into<Color>,
)
fn draw_spline_linear( &mut self, points: &[Vector2], thick: f32, color: impl Into<Color>, )
Draw spline: Linear, minimum 2 points
Sourcefn draw_spline_basis(
&mut self,
points: &[Vector2],
thick: f32,
color: impl Into<Color>,
)
fn draw_spline_basis( &mut self, points: &[Vector2], thick: f32, color: impl Into<Color>, )
Draw spline: B-Spline, minimum 4 points
Sourcefn draw_spline_catmull_rom(
&mut self,
points: &[Vector2],
thick: f32,
color: impl Into<Color>,
)
fn draw_spline_catmull_rom( &mut self, points: &[Vector2], thick: f32, color: impl Into<Color>, )
Draw spline: Catmull-Rom, minimum 4 points
Sourcefn draw_spline_bezier_quadratic(
&mut self,
points: &[Vector2],
thick: f32,
color: impl Into<Color>,
)
fn draw_spline_bezier_quadratic( &mut self, points: &[Vector2], thick: f32, color: impl Into<Color>, )
Draw spline: Quadratic Bezier, minimum 3 points (1 control point): [p1, c2, p3, c4…]
Sourcefn draw_spline_bezier_cubic(
&mut self,
points: &[Vector2],
thick: f32,
color: impl Into<Color>,
)
fn draw_spline_bezier_cubic( &mut self, points: &[Vector2], thick: f32, color: impl Into<Color>, )
Draw spline: Cubic Bezier, minimum 4 points (2 control points): [p1, c2, c3, p4, c5, c6…]
Sourcefn draw_spline_segment_linear(
&mut self,
p1: Vector2,
p2: Vector2,
thick: f32,
color: impl Into<Color>,
)
fn draw_spline_segment_linear( &mut self, p1: Vector2, p2: Vector2, thick: f32, color: impl Into<Color>, )
Draw spline segment: Linear, 2 points
Sourcefn draw_spline_segment_basis(
&mut self,
p1: Vector2,
p2: Vector2,
p3: Vector2,
p4: Vector2,
thick: f32,
color: impl Into<Color>,
)
fn draw_spline_segment_basis( &mut self, p1: Vector2, p2: Vector2, p3: Vector2, p4: Vector2, thick: f32, color: impl Into<Color>, )
Draw spline segment: B-Spline, 4 points
Sourcefn draw_spline_segment_catmull_rom(
&mut self,
p1: Vector2,
p2: Vector2,
p3: Vector2,
p4: Vector2,
thick: f32,
color: impl Into<Color>,
)
fn draw_spline_segment_catmull_rom( &mut self, p1: Vector2, p2: Vector2, p3: Vector2, p4: Vector2, thick: f32, color: impl Into<Color>, )
Draw spline segment: Catmull-Rom, 4 points
Sourcefn draw_spline_segment_bezier_quadratic(
&mut self,
p1: Vector2,
c2: Vector2,
p3: Vector2,
thick: f32,
color: impl Into<Color>,
)
fn draw_spline_segment_bezier_quadratic( &mut self, p1: Vector2, c2: Vector2, p3: Vector2, thick: f32, color: impl Into<Color>, )
Draw spline segment: Quadratic Bezier, 2 points, 1 control point
Sourcefn draw_spline_segment_bezier_cubic(
&mut self,
p1: Vector2,
c2: Vector2,
c3: Vector2,
p4: Vector2,
thick: f32,
color: impl Into<Color>,
)
fn draw_spline_segment_bezier_cubic( &mut self, p1: Vector2, c2: Vector2, c3: Vector2, p4: Vector2, thick: f32, color: impl Into<Color>, )
Draw spline segment: Cubic Bezier, 2 points, 2 control points
Sourcefn get_spline_point_linear(
&mut self,
start_pos: Vector2,
end_pos: Vector2,
t: f32,
) -> Vector2
fn get_spline_point_linear( &mut self, start_pos: Vector2, end_pos: Vector2, t: f32, ) -> Vector2
Get (evaluate) spline point: Linear
Sourcefn get_spline_point_basis(
&mut self,
p1: Vector2,
p2: Vector2,
p3: Vector2,
p4: Vector2,
t: f32,
) -> Vector2
fn get_spline_point_basis( &mut self, p1: Vector2, p2: Vector2, p3: Vector2, p4: Vector2, t: f32, ) -> Vector2
Get (evaluate) spline point: B-Spline
Sourcefn get_spline_point_catmull_rom(
&mut self,
p1: Vector2,
p2: Vector2,
p3: Vector2,
p4: Vector2,
t: f32,
) -> Vector2
fn get_spline_point_catmull_rom( &mut self, p1: Vector2, p2: Vector2, p3: Vector2, p4: Vector2, t: f32, ) -> Vector2
Get (evaluate) spline point: Catmull-Rom
Sourcefn get_spline_point_bezier_quad(
&mut self,
p1: Vector2,
c2: Vector2,
p3: Vector2,
t: f32,
) -> Vector2
fn get_spline_point_bezier_quad( &mut self, p1: Vector2, c2: Vector2, p3: Vector2, t: f32, ) -> Vector2
Get (evaluate) spline point: Quadratic Bezier
fn get_spline_point_bezier_cubic( &mut self, p1: Vector2, c2: Vector2, c3: Vector2, p4: Vector2, t: f32, ) -> Vector2
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.