Joined: Apr 2008
Posts: 1860
|
Description: These are all draw_background functions in GM. They are exactly the same except draw_background_general, which has 3 more arguments. It allows not only color for each individual corner, but also alpha. There are also 2 custom functions. draw_background_tiled_area and draw_background_tiled_area_ext which tiles background over a specific region.
Functions: draw_background(int back, double x, double y); draw_background_stretched(int back, double x, double y, double w, double h); draw_background_tiled(int back,double x,double y); draw_background_tiled_area(int back,double x,double y,double x1,double y1,double x2,double y2); draw_background_part(int back,double left,double top,double width,double height,double x,double y);
draw_background_ext(int back,double x,double y,double xscale,double yscale,double rot,int color,double alpha); draw_background_stretched_ext(int back,double x,double y,double w,double h,int color,double alpha); draw_background_tiled_ext(int back,double x,double y,double xscale,double yscale,int color,double alpha); draw_background_tiled_area_ext(int back,double x,double y,double x1,double y1,double x2,double y2, double xscale, double yscale, int color, double alpha); draw_background_part_ext(int back,double left,double top,double width,double height,double x,double y,double xscale,double yscale,int color,double alpha); draw_background_general(int back,double left,double top,double width,double height,double x,double y,double xscale,double yscale,double rot,int c1,int c2,int c3,int c4,double a1,double a2,double a3,double a4);
As the code itself would be too long to post here, I just added GSbackground.h and GSbackground.cpp as attachments. Note, there is a bug in that sprite functions will draw a background after one of these functions are called. I already posted a ticket, and when TGMG or Josh fixes that then I guess these functions will need a little upgrading. Also, while working on these functions I noticed that some of the sprite functions are incomplete too. Like draw_sprite_general doesn't use rotation argument. I will maybe change that too.
edit: "Bug" was solved. Redownload attachments.
|