draw_sprite_tiled_ext

Draws a sprite at a given position with scaling, blending and alpha, and tiles it to fill the entire view.

语法:

draw_sprite_tiled_ext(sprite, subimg, x, y, xscale, yscale, colour, 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).
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. A multiplier ' 1 = normal scaling, 0.5 is half etc.
y轴缩放 The vertical scaling of the sprite. A multiplier ' 1 = normal scaling, 0.5 is half etc.
colour The colour with which to blend the sprite. c_white is to display it normally.
alpha The alpha of the sprite (from 0 to 1 where 0 is transparent and 1 opaque).


返回: N/A(无返回值)


描述

This function will take a sprite and then repeatedly tile it across the whole view (or room if no view is defined), starting from the coordinates that you give in the function and with each tile scaled, colour blended and with the alpha that you define (these properties are the same as those used in draw_sprite_ext).

注意:启用WebGL时,建议仅为HTML5目标使用颜色混合,但如果未启用混合颜色,则仍可设置混合颜色,并且它将正常混合精灵。任何形式的混合会创建一个副本精灵储存在缓存,当需要时可供使用。如果你混合多种颜色,并且没有启用WebGL,将会降低你的游戏性能。如果你不希望使用WebGL,可以设置字体缓存大小以尝试使用函数 sprite_set_cache_size 来限制此值。


例如:

draw_sprite_tiled_ext(sprite_index, image_index, x, y, 2, 2, c_red, 0.5);

This will draw the instances assigned sprite (sprite_index) and its current frame of animation (image_index) at the instances own x and y position, but scaled to twice the normal size, blended red and with half the normal alpha. The sprite will be tiled horizontally and vertically across the view.


上一页: Drawing Sprites And Tiles
下一页: draw_enable_swf_aa
© Copyright YoYo Games Ltd. 2018 All Rights Reserved