dsfml.graphics.idrawable



interface IDrawable;
Interface for drawable object

Shape, String and Sprite implement IDrawable

abstract void setX(float x);
Set the left position of the object

Params:
float x New left coordinate

abstract void setY(float y);
Set the top position of the object

Params:
float y New top coordinate

abstract void setPosition(float x, float y);
Set the position of the object

Params:
float x New left coordinate
float y New top coordinate

abstract void setPosition(Vector2!(float) vec);
Set the position of the object

Params:
Vector2!(float) vec new position

abstract void setScaleX(float scale);
Set the horizontal scale of the object

Params:
float scale New horizontal scale (Strictly positive)

abstract void setScaleY(float scale);
Set the vertical scale of the object

Params:
float scale New vertical scale (Strictly positive)

abstract void setScale(float scaleX, float scaleY);
Set the scale of the object

Params:
float scaleX New horizontal scale
float scaleY New vertical scale

abstract void setScale(Vector2!(float) scale);
Set the scale of the object

Params:
Vector2!(float) scale new scale

abstract void setCenter(float centerX, float centerY);
Set the center of the object, in coordinates relative to the top-left of the object (take 2 values). The default center is (0, 0)

Params:

abstract void setCenter(Vector2!(float) center);
Set the center of the object, in coordinates relative to the top-left of the object (take a 2D vector). The default center is (0, 0)

Params:

abstract void setRotation(float angle);
Set the rotation of the object

Params:
float angle Angle of rotation, in degree

abstract void setColor(Color c);
Set the color

Params:
Color c New color

abstract void setBlendMode(BlendMode mode);
Set the blending mode for the object. The default blend mode is Blend.Alpha

Params:
BlendMode mode New blending mode

abstract Vector2!(float) getPosition();
Get the position of the object

Returns:
Current position



abstract Vector2!(float) getScale();
Get the current scale of the object

Returns:
Current scale

abstract Vector2!(float) getCenter();
Get the center of the object

Returns:
Current position of the center



abstract float getRotation();
Get the rotation angle of the object

Returns:
Angle of rotation, in degree

abstract Color getColor();
Get the color of the string

Returns:
Current color

abstract BlendMode getBlendMode();
Get the current blending mode

Returns:
Current blending mode

abstract void rotate(float angle);
Rotate the object Angle is added to the current orientation of the objet

Params:
float angle Angle of rotation in degree

abstract void move(float offsetX, float offsetY);
Move the object New offset is added to object current position

Params:
float offsetX Offset on the X axis
float offsetY Offset on the Y axis

abstract void move(Vector2!(float) offset);
Move the object New offset is added to object current position

Params:
Vector2!(float) offset Amount of units to move the object of

abstract void scale(float scaleX, float scaleY);
Set the scale of the object

Params:
float scaleX New horizontal scale (Strictly positive)
float scaleY New vertical scale (Strictly positive)

abstract void scale(Vector2!(float) factor);
Scale the object (take a 2D vector)

Params:
Vector2!(float) factor Scaling factors (both values must be strictly positive)


Page generated by Ddoc.