sf.Sprite Class Reference
sfSprite defines a sprite : texture, transformations, color, and draw on screen
Methods
FlipX(Flipped)
Flip the sprite horizontally.
Flipped : True to flip the sprite
FlipY(Flipped)
Flip the sprite vertically.
Flipped : True to flip the sprite
GetCenter()
Get the center of the object, in coordinates relative to the object.
Inherited
GetColor()
Get the color of the object.
Inherited
GetImage()
Get the source image of the sprite.
GetPixel()
Get the color of a given pixel in the sprite.
GetPosition()
Get the position of the object.
Inherited
GetRotation()
Get the orientation of the object.
Inherited
GetScale()
Get the scale of the object.
Inherited
GetSize()
Get the sprite's size.
GetSubRect()
Get the sub-rectangle of the sprite inside the source image.
Move(OffsetX, OffsetY)
Move the object.
OffsetX : X offset
OffsetY : Y offset
Inherited
Resize(Width, Height)
Resize the sprite (by changing its scale factors). The default size is defined by the subrect.
Width : New width (must be strictly positive)
Height : New height (must be strictly positive)
Rotate(Angle)
Rotate the object.
Angle : Angle of rotation, in degrees
Inherited
Scale(FactorX, FactorY)
Scale the object.
FactorX : Scaling factor on X (must be strictly positive)
FactorY : Scaling factor on Y (must be strictly positive)
Inherited
SetBlendMode(Mode)
Set the blending mode for the object. The default blend mode is sf.Blend.Alpha
Mode : New blending mode
Inherited
SetCenter(CenterX, CenterY)
Set the center of the object, in coordinates relative to the object.
CenterX : X coordinate of the center
CenterY : Y coordinate of the center
Inherited
SetColor(Color)
Set the color of the object.
Color : New color
Inherited
SetImage(Image)
Change the image of the sprite.
Image : new image (sf.Image instance)
SetPosition(X, Y)
Set the position of the object.
X : New X coordinate
Y : New Y coordinate
Inherited
SetRotation(Rotation)
Set the orientation of the object.
Rotation : Angle of rotation, in degrees
Inherited
SetScale(ScaleX, ScaleY)
Set the scale of the object.
ScaleX : New horizontal scale (must be strictly positive)
ScaleY : New vertical scale (must be strictly positive)
Inherited
SetScaleX(ScaleX)
Set the X scale factor of the object.
ScaleX : New horizontal scale (must be strictly positive)
Inherited
SetScaleY(ScaleY)
Set the Y scale factor of the object.
ScaleY : New vertical scale (must be strictly positive)
Inherited
SetSubRect(SubRect)
Set the sub-rectangle of the sprite inside the source image. By default, the subrect covers the entire source image.
SubRect : New sub-rectangle
SetX(X)
Set the X position of the object.
X : New X coordinate
Inherited
SetY(Y)
Set the Y position of the object.
Y : New Y coordinate
Inherited
TransformToGlobal(X, Y)
Transform a point from local coordinates into global coordinates (ie it applies the object's center, translation, rotation and scale to the point). Returns a tuple.
X : X coordinate of the point to transform
Y : Y coordinate of the point to transform
Inherited
TransformToLocal(X, Y)
Transform a point from global coordinates into local coordinates (ie it applies the inverse of object's center, translation, rotation and scale to the point). Returns a tuple.
X : X coordinate of the point to transform
Y : Y coordinate of the point to transform
Inherited