Modules | |
Bitmap positioning flags. | |
Options for scaling bitmaps that don't match screen/window size. | |
Data Structures | |
struct | XY_bitmap |
Bitmap type. More... | |
XY_bitmap * | XY_load_bitmap (char *filename) |
Create a bitmap based on an image file. | |
XY_bitmap * | XY_load_bitmap_from_buffer (unsigned char *buffer, int size) |
Create a bitmap based on image data in a buffer. | |
void | XY_free_bitmap (XY_bitmap *bitmap) |
Free a bitmap. | |
XY_bool | XY_set_background (XY_color color, XY_bitmap *bitmap, XY_fixed x, XY_fixed y, int posflags, int scaling) |
Set the background color, and optional bitmap, its position, and options for scaling it to the screen size. | |
void | XY_enable_background (XY_bool enable) |
Enable or disable the background bitmap (affects next frame). |
XY_bitmap* XY_load_bitmap | ( | char * | filename | ) |
Create a bitmap based on an image file.
filename | is the name of an image file to attempt to load. |
XY_bitmap* XY_load_bitmap_from_buffer | ( | unsigned char * | buffer, | |
int | size | |||
) |
Create a bitmap based on image data in a buffer.
buffer | is a pointer to memory containing image file data. | |
size | is the size of the image file data. |
void XY_free_bitmap | ( | XY_bitmap * | bitmap | ) |
Free a bitmap.
bitmap | is an XY_bitmap pointer to free. (Do not use the pointer any more! You may reuse your variable, if you create a new bitmap, of course.) |
XY_bool XY_set_background | ( | XY_color | color, | |
XY_bitmap * | bitmap, | |||
XY_fixed | x, | |||
XY_fixed | y, | |||
int | posflags, | |||
int | scaling | |||
) |
Set the background color, and optional bitmap, its position, and options for scaling it to the screen size.
Enables background bitmap.
color | is an XY_color for the display's background. (The entire display will be this color, if no bitmap is provided, otherwise any part of the display not covered by the bitmap will be this color. Lines alpha-blended or anti-aliased in 'fake' rendering mode will blend against this color, as well.) | |
bitmap | is an XY_bitmap pointer for a background image to use. It may be NULL if no background image is desired. | |
x | represents how far right (or left, if negative) to nudge the background image after it has been positioned, in canvas units. Use 0 for no nudging. | |
y | represents how far down (or up, if negative) to nudge the background image after it has been positioned, in canvas units. Use 0 for no nudging. | |
posflags | determines how to position a bitmap. Use the "|" (or) bitwise operator to combine one horizontal choice (XY_POS_LEFT, XY_POS_HCENTER or XY_POS_RIGHT) with one vertical choice (XY_POS_TOP, XY_POS_VCENTER or XY_POS_BOTTOM). Use 0 as a shortcut for 'top left'. | |
scaling | describes how the bitmap should be scaled. Use one of the following: XY_SCALE_NONE, XY_SCALE_STRETCH, XY_SCALE_KEEP_ASPECT_WIDE or XY_SCALE_KEEP_ASPECT_TALL. |
void XY_enable_background | ( | XY_bool | enable | ) |