Struct sfml::graphics::RectangleShape
source · [−]pub struct RectangleShape<'s> { /* private fields */ }
Expand description
Specialized shape representing a rectangle
Implementations
sourceimpl<'s> RectangleShape<'s>
impl<'s> RectangleShape<'s>
sourcepub fn new() -> RectangleShape<'s>
pub fn new() -> RectangleShape<'s>
Returns a new RectangleShape
.
sourcepub fn with_texture(texture: &'s Texture) -> RectangleShape<'s>
pub fn with_texture(texture: &'s Texture) -> RectangleShape<'s>
Returns a new RectangleShape
with the provided texture.
sourcepub fn with_size(size: Vector2f) -> RectangleShape<'s>
pub fn with_size(size: Vector2f) -> RectangleShape<'s>
Returns a new RectangleShape
with the provided size.
sourcepub fn from_rect(rect: FloatRect) -> Self
pub fn from_rect(rect: FloatRect) -> Self
Returns a new RectangleShape
created from a FloatRect
.
Trait Implementations
sourceimpl<'s> Clone for RectangleShape<'s>
impl<'s> Clone for RectangleShape<'s>
sourcefn clone(&self) -> RectangleShape<'s>
fn clone(&self) -> RectangleShape<'s>
Return a new RectangleShape
or panic! if there is not enough memory
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl<'s> Debug for RectangleShape<'s>
impl<'s> Debug for RectangleShape<'s>
sourceimpl<'s> Default for RectangleShape<'s>
impl<'s> Default for RectangleShape<'s>
sourceimpl<'s> Drawable for RectangleShape<'s>
impl<'s> Drawable for RectangleShape<'s>
sourcefn 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>
)
sourceimpl<'s> Drop for RectangleShape<'s>
impl<'s> Drop for RectangleShape<'s>
sourceimpl<'s> Shape<'s> for RectangleShape<'s>
impl<'s> Shape<'s> for RectangleShape<'s>
sourcefn 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
sourcefn disable_texture(&mut self)
fn disable_texture(&mut self)
Disables texturing for this shape.
sourcefn 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
sourcefn set_fill_color(&mut self, color: Color)
fn set_fill_color(&mut self, color: Color)
Sets the fill color of the shape. Read more
sourcefn set_outline_color(&mut self, color: Color)
fn set_outline_color(&mut self, color: Color)
Sets the outline color of the shape. Read more
sourcefn 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
sourcefn texture_rect(&self) -> IntRect
fn texture_rect(&self) -> IntRect
Gets the sub-rectangle of the texture displayed by the shape.
sourcefn fill_color(&self) -> Color
fn fill_color(&self) -> Color
Gets the fill color of this shape.
sourcefn outline_color(&self) -> Color
fn outline_color(&self) -> Color
Gets the outline color of this shape.
sourcefn outline_thickness(&self) -> f32
fn outline_thickness(&self) -> f32
Gets the outline thickness of this shape.
sourcefn point_count(&self) -> u32
fn point_count(&self) -> u32
Gets the total number of points of the shape.
sourcefn local_bounds(&self) -> FloatRect
fn local_bounds(&self) -> FloatRect
Gets the local bounding rectangle of the entity. Read more
sourcefn global_bounds(&self) -> FloatRect
fn global_bounds(&self) -> FloatRect
Gets the global (non-minimal) bounding rectangle of the entity. Read more
sourceimpl<'s> Transformable for RectangleShape<'s>
impl<'s> Transformable for RectangleShape<'s>
sourcefn 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
sourcefn set_rotation(&mut self, angle: f32)
fn set_rotation(&mut self, angle: f32)
Set the orientation of the object. Read more
sourcefn 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
sourcefn 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
sourcefn 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
sourcefn inverse_transform(&self) -> &Transform
fn inverse_transform(&self) -> &Transform
Gets the inverse combined transform of the object.
Auto Trait Implementations
impl<'s> RefUnwindSafe for RectangleShape<'s>
impl<'s> !Send for RectangleShape<'s>
impl<'s> !Sync for RectangleShape<'s>
impl<'s> Unpin for RectangleShape<'s>
impl<'s> UnwindSafe for RectangleShape<'s>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more