draw_sprite_general(sprite, subimg, left, top, width, height, x, y, xscale, yscale, rot, c1, c2, c3, c4, alpha);
参数 | 描述 |
---|---|
sprite | The index of the sprite to draw. |
subimg | The subimg (frame) of the sprite to draw (image_index or -1 correlate to the current frame of animation in the object). |
left | The x position on the sprite of the top left corner of the area to draw. |
top | The y position on the sprite of the top left corner of the area to draw. |
宽度 | The width of the area to draw. |
高度 | The height of the area to draw. |
x | The x coordinate of where to draw the sprite. |
y | The y coordinate of where to draw the sprite. |
x轴缩放 | The horizontal scaling of the sprite, as a multiplier: 1 = normal scaling, 0.5 is half etc... |
y轴缩放 | The vertical scaling of the sprite, as a multiplier: 1 = normal scaling, 0.5 is half etc... |
rot | The rotation of the sprite. 0=normal, 90=turned 90 degrees counter-clockwise etc. |
c1 | The colour with which to blend the top left area of the sprite. |
c2 | The colour with which to blend the top right area of the sprite. |
c3 | The colour with which to blend the bottom right area of the sprite. |
c4 | The colour with which to blend the bottom left area of the sprite. |
alpha | The alpha of the sprite (from 0 to 1 where 0 is transparent and 1 opaque). |
返回: N/A(无返回值)
This function combines the function draw_sprite_ext with the function draw_sprite_part, adding in some additional blending options so that each corner of the final sprite part can be blended with an individual colour.
draw_sprite_general(sprite_index, image_index, 8, 8, sprite_width-16, sprite_height-16, x, y, 2, 0.5, 180, c_white, c_white, c_black, c_black, 1);
This will draw the instances assigned sprite (sprite_index) and its current frame of animation (image_index), however it will shave an 8px margin off all four sides of the sprite. It will be stretched to double its usual width but half its usual height. It will be opaque, and upside down. The top area of the sprite will be blended white and hence normal, but the bottom area will be black, meaning the sprite will go from normal to a silhouette downwards in a smooth gradient.