[−][src]Struct sfml::graphics::ConvexShape
Specialized shape representing a convex polygon
It is important to keep in mind that a convex shape must always be... convex, otherwise it may not be drawn correctly. Moreover, the points must be defined in order; using a random order would result in an incorrect shape.
Methods
impl<'s> ConvexShape<'s>
[src]
pub fn new(points_count: u32) -> ConvexShape<'s>
[src]
pub fn with_texture(points_count: u32, texture: &'s Texture) -> ConvexShape<'s>
[src]
Create a new convex shape with a texture
Arguments
- texture - The texture to apply to the convex shape
- points_count - The number of point for the convex shape
pub fn set_point<P: Into<Vector2f>>(&mut self, index: u32, point: P)
[src]
Set the position of a point.
Don't forget that the polygon must remain convex, and the points need to stay ordered!
set_point_count
must be called first in order to set the total number of points.
The result is undefined if index is out of the valid range.
Arguments
- index - Index of the point to change, in range
[0 .. get_point_count() - 1]
- point - New position of the point
pub fn set_point_count(&mut self, count: u32)
[src]
ⓘImportant traits for ConvexShapePointspub fn points(&self) -> ConvexShapePoints
[src]
Return an immutable iterator over all the points of the ConvexShape
Trait Implementations
impl<'s> Drawable for ConvexShape<'s>
[src]
fn draw<'a: 'shader, 'texture, 'shader, 'shader_texture>(
&'a self,
target: &mut dyn RenderTarget,
states: RenderStates<'texture, 'shader, 'shader_texture>
)
[src]
&'a self,
target: &mut dyn RenderTarget,
states: RenderStates<'texture, 'shader, 'shader_texture>
)
impl<'s> Shape<'s> for ConvexShape<'s>
[src]
fn set_texture(&mut self, texture: &'s Texture, reset_rect: bool)
[src]
fn disable_texture(&mut self)
[src]
fn set_texture_rect(&mut self, rect: &IntRect)
[src]
fn set_fill_color(&mut self, color: Color)
[src]
fn set_outline_color(&mut self, color: Color)
[src]
fn set_outline_thickness(&mut self, thickness: f32)
[src]
fn texture(&self) -> Option<&'s Texture>
[src]
fn texture_rect(&self) -> IntRect
[src]
fn fill_color(&self) -> Color
[src]
fn outline_color(&self) -> Color
[src]
fn outline_thickness(&self) -> f32
[src]
fn point_count(&self) -> u32
[src]
fn point(&self, index: u32) -> Vector2f
[src]
fn local_bounds(&self) -> FloatRect
[src]
fn global_bounds(&self) -> FloatRect
[src]
impl<'s> Transformable for ConvexShape<'s>
[src]
fn set_position<P: Into<Vector2f>>(&mut self, position: P)
[src]
fn set_rotation(&mut self, angle: f32)
[src]
fn set_scale<S: Into<Vector2f>>(&mut self, scale: S)
[src]
fn set_origin<O: Into<Vector2f>>(&mut self, origin: O)
[src]
fn position(&self) -> Vector2f
[src]
fn rotation(&self) -> f32
[src]
fn get_scale(&self) -> Vector2f
[src]
fn origin(&self) -> Vector2f
[src]
fn move_<O: Into<Vector2f>>(&mut self, offset: O)
[src]
fn rotate(&mut self, angle: f32)
[src]
fn scale<F: Into<Vector2f>>(&mut self, factors: F)
[src]
fn transform(&self) -> Transform
[src]
fn inverse_transform(&self) -> Transform
[src]
impl<'s> Drop for ConvexShape<'s>
[src]
impl<'s> Clone for ConvexShape<'s>
[src]
fn clone(&self) -> ConvexShape<'s>
[src]
Return a new ConvexShape or panic! if there is not enough memory
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'s> Debug for ConvexShape<'s>
[src]
Auto Trait Implementations
impl<'s> !Send for ConvexShape<'s>
impl<'s> !Sync for ConvexShape<'s>
impl<'s> Unpin for ConvexShape<'s>
impl<'s> UnwindSafe for ConvexShape<'s>
impl<'s> RefUnwindSafe for ConvexShape<'s>
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,