draw_surface_part


语法:

draw_surface_part(id, left, top, w, h, x, y);

参数 描述
id The unique ID value of the surface to draw.
left The left position in the surface of the part to be drawn.
top The top position in the surface of the part to be drawn.
w The width of the part to be draw, from left.
h The height of the part to be drawn, from top.
x The x position of where to draw the surface.
y The y position of where to draw the surface.


Returns:

N/A(无返回值)


描述

With this function you can draw part of any surface at a given position within the room. As with draw_surface you can specify a surface, but you then need to specify the relative coordinates within the surface of an area to select for drawing. This means that a left position of 0 and a top position of 0 would be the top left corner of the surface and all further coordinates should be taken from that position.

注:由于储存在显存里,表面层运行时存在随时停止并退出的可能性。在直接引用它们之前,你需要 一直使用 surface_exists检测表面层是否退出。更多信息请查阅 表面层


例如:

draw_surface_part(surf, 8, 8, 32, 32, x, y);

This will draw a 32x32 area 8px by 8px in from the top left of the surface indexed in "surf", at the instances (x,y) position.