Struct ggez::graphics::MeshBuilder
source · pub struct MeshBuilder { /* private fields */ }
Expand description
Builder pattern for constructing meshes.
Implementations§
source§impl MeshBuilder
impl MeshBuilder
sourcepub fn new() -> Self
pub fn new() -> Self
Create a new MeshBuilder
.
sourcepub fn line<P>(
&mut self,
points: &[P],
width: f32,
color: Color
) -> GameResult<&mut Self>where
P: Into<Point2<f32>> + Clone,
pub fn line<P>( &mut self, points: &[P], width: f32, color: Color ) -> GameResult<&mut Self>where P: Into<Point2<f32>> + Clone,
Create a new mesh for a line of one or more connected segments.
sourcepub fn circle<P>(
&mut self,
mode: DrawMode,
point: P,
radius: f32,
tolerance: f32,
color: Color
) -> GameResult<&mut Self>where
P: Into<Point2<f32>>,
pub fn circle<P>( &mut self, mode: DrawMode, point: P, radius: f32, tolerance: f32, color: Color ) -> GameResult<&mut Self>where P: Into<Point2<f32>>,
Create a new mesh for a circle.
For the meaning of the tolerance
parameter, see here.
sourcepub fn ellipse<P>(
&mut self,
mode: DrawMode,
point: P,
radius1: f32,
radius2: f32,
tolerance: f32,
color: Color
) -> GameResult<&mut Self>where
P: Into<Point2<f32>>,
pub fn ellipse<P>( &mut self, mode: DrawMode, point: P, radius1: f32, radius2: f32, tolerance: f32, color: Color ) -> GameResult<&mut Self>where P: Into<Point2<f32>>,
Create a new mesh for an ellipse.
For the meaning of the tolerance
parameter, see here.
sourcepub fn polyline<P>(
&mut self,
mode: DrawMode,
points: &[P],
color: Color
) -> GameResult<&mut Self>where
P: Into<Point2<f32>> + Clone,
pub fn polyline<P>( &mut self, mode: DrawMode, points: &[P], color: Color ) -> GameResult<&mut Self>where P: Into<Point2<f32>> + Clone,
Create a new mesh for a series of connected lines.
sourcepub fn polygon<P>(
&mut self,
mode: DrawMode,
points: &[P],
color: Color
) -> GameResult<&mut Self>where
P: Into<Point2<f32>> + Clone,
pub fn polygon<P>( &mut self, mode: DrawMode, points: &[P], color: Color ) -> GameResult<&mut Self>where P: Into<Point2<f32>> + Clone,
Create a new mesh for a closed polygon. The points given must be in clockwise order, otherwise at best the polygon will not draw.
sourcepub fn polyline_with_vertex_builder<P, V>(
&mut self,
mode: DrawMode,
points: &[P],
is_closed: bool,
vb: V
) -> GameResult<&mut Self>where
P: Into<Point2<f32>> + Clone,
V: StrokeVertexConstructor<Vertex> + FillVertexConstructor<Vertex>,
pub fn polyline_with_vertex_builder<P, V>( &mut self, mode: DrawMode, points: &[P], is_closed: bool, vb: V ) -> GameResult<&mut Self>where P: Into<Point2<f32>> + Clone, V: StrokeVertexConstructor<Vertex> + FillVertexConstructor<Vertex>,
Create a new mesh for a given polyline using a custom vertex builder. The points given must be in clockwise order.
sourcepub fn rectangle(
&mut self,
mode: DrawMode,
bounds: Rect,
color: Color
) -> GameResult<&mut Self>
pub fn rectangle( &mut self, mode: DrawMode, bounds: Rect, color: Color ) -> GameResult<&mut Self>
Create a new mesh for a rectangle.
sourcepub fn rounded_rectangle(
&mut self,
mode: DrawMode,
bounds: Rect,
radius: f32,
color: Color
) -> GameResult<&mut Self>
pub fn rounded_rectangle( &mut self, mode: DrawMode, bounds: Rect, radius: f32, color: Color ) -> GameResult<&mut Self>
Create a new mesh for a rounded rectangle.
Trait Implementations§
source§impl Clone for MeshBuilder
impl Clone for MeshBuilder
source§fn clone(&self) -> MeshBuilder
fn clone(&self) -> MeshBuilder
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for MeshBuilder
impl Debug for MeshBuilder
Auto Trait Implementations§
impl RefUnwindSafe for MeshBuilder
impl Send for MeshBuilder
impl Sync for MeshBuilder
impl Unpin for MeshBuilder
impl UnwindSafe for MeshBuilder
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
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
source§impl<T> HasMut<T> for T
impl<T> HasMut<T> for T
source§fn retrieve_mut(&mut self) -> &mut T
fn retrieve_mut(&mut self) -> &mut T
Method to retrieve the context type as mutable.