Struct sfml::graphics::CircleShape
source · pub struct CircleShape<'s> { /* private fields */ }
Expand description
Specialized shape representing a circle.
Implementations§
source§impl<'s> CircleShape<'s>
impl<'s> CircleShape<'s>
sourcepub fn with_texture(texture: &'s Texture) -> CircleShape<'s>
pub fn with_texture(texture: &'s Texture) -> CircleShape<'s>
Create a new circle shape initialized with a texture
Arguments
- texture - The texture to initialize the
CircleShape
with.
sourcepub fn new(radius: f32, point_count: usize) -> CircleShape<'s>
pub fn new(radius: f32, point_count: usize) -> CircleShape<'s>
Create a new CircleShape
and initialize it.
Arguments:
- radius - The radius of the
CircleShape
point_count
- The number of points to define theCircleShape
Default value on SFML are radius = 0 / pointCount = 30
sourcepub fn set_radius(&mut self, radius: f32)
pub fn set_radius(&mut self, radius: f32)
sourcepub fn set_point_count(&mut self, count: usize)
pub fn set_point_count(&mut self, count: usize)
Trait Implementations§
source§impl<'s> Clone for CircleShape<'s>
impl<'s> Clone for CircleShape<'s>
source§fn clone(&self) -> CircleShape<'s>
fn clone(&self) -> CircleShape<'s>
Return a new CircleShape
or panic if there is not enough memory
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<'s> Debug for CircleShape<'s>
impl<'s> Debug for CircleShape<'s>
source§impl<'s> Default for CircleShape<'s>
impl<'s> Default for CircleShape<'s>
source§impl<'s> Drawable for CircleShape<'s>
impl<'s> Drawable for CircleShape<'s>
source§fn draw<'a: 'shader, 'texture, 'shader, 'shader_texture>(
&'a self,
target: &mut dyn RenderTarget,
states: &RenderStates<'texture, 'shader, 'shader_texture>
)
fn draw<'a: 'shader, 'texture, 'shader, 'shader_texture>(
&'a self,
target: &mut dyn RenderTarget,
states: &RenderStates<'texture, 'shader, 'shader_texture>
)
source§impl<'s> Drop for CircleShape<'s>
impl<'s> Drop for CircleShape<'s>
source§impl<'s> Shape<'s> for CircleShape<'s>
impl<'s> Shape<'s> for CircleShape<'s>
source§fn set_texture(&mut self, texture: &'s Texture, reset_rect: bool)
fn set_texture(&mut self, texture: &'s Texture, reset_rect: bool)
Changes the source texture of the shape. Read more
source§fn disable_texture(&mut self)
fn disable_texture(&mut self)
Disables texturing for this shape.
source§fn set_texture_rect(&mut self, rect: IntRect)
fn set_texture_rect(&mut self, rect: IntRect)
Sets the sub-rectangle of the texture that the shape will display. Read more
source§fn set_fill_color(&mut self, color: Color)
fn set_fill_color(&mut self, color: Color)
Sets the fill color of the shape. Read more
source§fn set_outline_color(&mut self, color: Color)
fn set_outline_color(&mut self, color: Color)
Sets the outline color of the shape. Read more
source§fn set_outline_thickness(&mut self, thickness: f32)
fn set_outline_thickness(&mut self, thickness: f32)
Sets the thickness of the shape’s outline. Read more
source§fn texture_rect(&self) -> IntRect
fn texture_rect(&self) -> IntRect
Gets the sub-rectangle of the texture displayed by the shape.
source§fn fill_color(&self) -> Color
fn fill_color(&self) -> Color
Gets the fill color of this shape.
source§fn outline_color(&self) -> Color
fn outline_color(&self) -> Color
Gets the outline color of this shape.
source§fn outline_thickness(&self) -> f32
fn outline_thickness(&self) -> f32
Gets the outline thickness of this shape.
source§fn point_count(&self) -> usize
fn point_count(&self) -> usize
Gets the total number of points of the shape.
source§fn local_bounds(&self) -> FloatRect
fn local_bounds(&self) -> FloatRect
Gets the local bounding rectangle of the entity. Read more
source§fn global_bounds(&self) -> FloatRect
fn global_bounds(&self) -> FloatRect
Gets the global (non-minimal) bounding rectangle of the entity. Read more
source§impl<'s> Transformable for CircleShape<'s>
impl<'s> Transformable for CircleShape<'s>
source§fn set_position<P: Into<Vector2f>>(&mut self, position: P)
fn set_position<P: Into<Vector2f>>(&mut self, position: P)
Sets the position of the object. Read more
source§fn set_rotation(&mut self, angle: f32)
fn set_rotation(&mut self, angle: f32)
Set the orientation of the object. Read more
source§fn set_scale<S: Into<Vector2f>>(&mut self, scale: S)
fn set_scale<S: Into<Vector2f>>(&mut self, scale: S)
Sets the scale factors of the object. Read more
source§fn set_origin<O: Into<Vector2f>>(&mut self, origin: O)
fn set_origin<O: Into<Vector2f>>(&mut self, origin: O)
Sets the local origin of the object. Read more
source§fn move_<O: Into<Vector2f>>(&mut self, offset: O)
fn move_<O: Into<Vector2f>>(&mut self, offset: O)
Moves the object by a given offset. Read more
source§fn inverse_transform(&self) -> &Transform
fn inverse_transform(&self) -> &Transform
Gets the inverse combined transform of the object.