surface_get_width

Finds the pixel width of a surface.

Syntax:

surface_get_width(surface_id);


Argument Description
surface_id The ID of the surface to get the width of.


Returns: Real


Description

This function simply returns the width, in pixels, of the indexed surface.

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:

sw = surface_get_width(surf);

The above code will store the width of the surface indexed in the variable "surf" in the variable "sw".


Back: Surfaces
Next: surface_get_texture
© Copyright YoYo Games Ltd. 2018 All Rights Reserved