The "draw_surface_scaled_ext" Function
#
SyntaxArgument | Type | Description |
---|---|---|
surf | surface | The surface to draw scaled |
x | real | The horizontal room coordinate at which to draw the surface |
y | real | The vertical room coordinate at which to draw the surface |
ratio | real | Percentage of the view to occupy, as a value ranging from 0-1 |
min | real | Minimum allowable ratio, or percentage of the view |
max | real | Maximum allowable ratio, or percentage of the view |
rot | real | The surface rotation angle, in degrees |
col | color | The surface blending color to draw, where c_white is default |
alpha | real | The surface transparency, ranging from 0-1 |
#
DescriptionDraws a surface scaled relative to the size of the active view camera. Ratio is calculated as a percentage of view width OR height (whichever is greater), with a value of 1 fully covering the view at any aspect (e.g. for backgrounds).
Because this ratio alone may result in surfaces smaller or larger than desirable on one axis, a min and max ratio can also be supplied to limit size on the other axis than is calculated for the base ratio (e.g. for HUD elements). If max is set to 0, clamping will be disabled.
Also returns the scale multiplier, which can be used to position or scale other elements relative to the drawn surface.
caution
Because surface data is volatile, surfaces are likely to be destroyed if the window is resized. Always check if a surface exists before drawing, and include regeneration code if it does not.