draw_surface_part_ext

Draws part of a surface but now with scale factors, colour blending and transparency settings.

Syntax:

GML Code Example

draw_surface_part_ext(index, left, top, w, h, x, y, xscale, yscale, colour, alpha);


Argument Description
index The index 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.
width The width of the part to be draw, from left.
height 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.
xscale The horizontal scaling the part should be drawn with.
yscale The vertical scaling the part should be drawn with.
colour The colour blending the part should be drawn with.
alpha The alpha transparency the part should be drawn with.


Returns: N/A


Description

This function will draw a part of the chosen surface at the given position following the same rules as per draw_surface_part, only now you can scale the part, blend a colour with it, or change its alpha when drawing it to the screen (the same as when drawing a surface with draw_surface_ext).

NOTE: When working with surfaces there is the possibility that they can cease to exist at any time due to them being stored in texture memory. You should ALWAYS check that a surface exists using surface_exists before referencing them directly. For further information see Surfaces.


Example:

GML Code Example

draw_surface_part_ext(surf, 8, 8, 32, 32, x, y, 2, 0.5, c_black, 1);

This will draw a 32x32 pixel area from 8x8 pixels into the surface indexed in the variable "surf". It will be stretched to double its usual width but half its usual height. It will be opaque and it will be blended with black (turning it into a silhouette).





No Examples Submitted

Does this page need better examples? Be the first to Submit

No Edits Suggested

Is this page unclear or not descriptive enough? Suggest an edit to the page and with enough upvotes your changes will be made.

No Questions Have Been Ask

Do you have a question about this page? Ask it Here