sf.Drawable Class Reference

Abstract base class for every object that can be drawn into a render window.

Methods

GetCenter()
Get the center of the object, in coordinates relative to the object.
GetColor()
Get the color of the object.
GetPosition()
Get the position of the object.
GetRotation()
Get the orientation of the object.
GetScale()
Get the scale of the object.
Move(OffsetX, OffsetY)
Move the object.
    OffsetX : X offset
    OffsetY : Y offset
Rotate(Angle)
Rotate the object.
    Angle : Angle of rotation, in degrees
Scale(FactorX, FactorY)
Scale the object.
    FactorX : Scaling factor on X (must be strictly positive)
    FactorY : Scaling factor on Y (must be strictly positive)
SetBlendMode(Mode)
Set the blending mode for the object. The default blend mode is sf.Blend.Alpha
    Mode : New blending mode
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
SetColor(Color)
Set the color of the object.
    Color : New color
SetPosition(X, Y)
Set the position of the object.
    X : New X coordinate
    Y : New Y coordinate
SetRotation(Rotation)
Set the orientation of the object.
    Rotation : Angle of rotation, in degrees
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)
SetScaleX(ScaleX)
Set the X scale factor of the object.
    ScaleX     : New horizontal scale (must be strictly positive)
SetScaleY(ScaleY)
Set the Y scale factor of the object.
    ScaleY     : New vertical scale (must be strictly positive)
SetX(X)
Set the X position of the object.
    X : New X coordinate
SetY(Y)
Set the Y position of the object.
    Y : New Y coordinate
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
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