Public Member Functions | |
Image (Graphics &graphics, const std::wstring &filename, bool hardBorders=false) | |
Image (Graphics &graphics, const std::wstring &filename, unsigned srcX, unsigned srcY, unsigned srcWidth, unsigned srcHeight, bool hardBorders=false) | |
Image (Graphics &graphics, const Bitmap &source, bool hardBorders=false) | |
Image (Graphics &graphics, const Bitmap &source, unsigned srcX, unsigned srcY, unsigned srcWidth, unsigned srcHeight, bool hardBorders=false) | |
unsigned | width () const |
unsigned | height () const |
void | draw (double x, double y, ZPos z, double factorX=1, double factorY=1, Color c=Colors::white, AlphaMode mode=amDefault) const |
void | drawMod (double x, double y, ZPos z, double factorX, double factorY, Color c1, Color c2, Color c3, Color c4, AlphaMode mode=amDefault) const |
void | drawRot (double x, double y, ZPos z, double angle, double centerX=0.5, double centerY=0.5, double factorX=1, double factorY=1, Color c=Colors::white, AlphaMode mode=amDefault) const |
void | drawRotFlip (double x, double y, ZPos z, RotFlip rf, double factorX=1, double factorY=1, Color c=Colors::white, AlphaMode mode=amDefault) const |
void | drawRotFlipMod (double x, double y, ZPos z, RotFlip rf, double factorX, double factorY, Color c1, Color c2, Color c3, Color c4, AlphaMode mode=amDefault) const |
const ImageData & | getData () const |
Gosu::Image::Image | ( | Graphics & | graphics, | |
const std::wstring & | filename, | |||
bool | hardBorders = false | |||
) |
Loads an image from a given filename that can be drawn onto graphics.
This constructor can handle PNG and BMP images. A color key of ff00ff is automatically applied to BMP type images. For more flexibility, use the corresponding constructor that uses a Bitmap object.
Gosu::Image::Image | ( | Graphics & | graphics, | |
const std::wstring & | filename, | |||
unsigned | srcX, | |||
unsigned | srcY, | |||
unsigned | srcWidth, | |||
unsigned | srcHeight, | |||
bool | hardBorders = false | |||
) |
Loads a portion of the the image at the given filename that can be drawn onto graphics.
This constructor can handle PNG and BMP images. A color key of ff00ff is automatically applied to BMP type images. For more flexibility, use the corresponding constructor that uses a Bitmap object.
Converts the given bitmap into an image that can be drawn onto graphics.
Gosu::Image::Image | ( | Graphics & | graphics, | |
const Bitmap & | source, | |||
unsigned | srcX, | |||
unsigned | srcY, | |||
unsigned | srcWidth, | |||
unsigned | srcHeight, | |||
bool | hardBorders = false | |||
) |
Converts a portion of the given bitmap into an image that can be drawn onto graphics.
void Gosu::Image::draw | ( | double | x, | |
double | y, | |||
ZPos | z, | |||
double | factorX = 1 , |
|||
double | factorY = 1 , |
|||
Color | c = Colors::white , |
|||
AlphaMode | mode = amDefault | |||
) | const |
Draws the image so its upper left corner is at (x; y).
void Gosu::Image::drawMod | ( | double | x, | |
double | y, | |||
ZPos | z, | |||
double | factorX, | |||
double | factorY, | |||
Color | c1, | |||
Color | c2, | |||
Color | c3, | |||
Color | c4, | |||
AlphaMode | mode = amDefault | |||
) | const |
Like draw(), but allows to give modulation colors for all four corners.
void Gosu::Image::drawRot | ( | double | x, | |
double | y, | |||
ZPos | z, | |||
double | angle, | |||
double | centerX = 0.5 , |
|||
double | centerY = 0.5 , |
|||
double | factorX = 1 , |
|||
double | factorY = 1 , |
|||
Color | c = Colors::white , |
|||
AlphaMode | mode = amDefault | |||
) | const |
Draws the image rotated by the given angle so that its rotation center is at (x; y).
Note that this is different from how all the other drawing functions work!
const ImageData& Gosu::Image::getData | ( | ) | const |
Provides access to the underlying image data object.