texture_set_interpolation

Indicates whether to use linear interpolation or not.

Syntax:

texture_set_interpolation(linear);


Argument Description
linear Turn linear interpolation on (true) or off (false).


Returns: N/A


Description

This function can be used to set the linear interpolation of all images drawn on the game screen with GameMaker: Studio. When this is set to on (true) all textures will be smoothed when drawn (this includes sprites as they too are considered textures), meaning that when scaled or moved if there is not a 1:1 pixel ratio then there will be a "smudging" across various pixels which may make images appear blurry depending on the art style used. If this is switch off (false) then images will be drawn based on the nearest pixel when scaled or moving which may lead to "blocky" images. The default value is false, and this can also be changed in the Global Game Settings for individual target platforms.

NOTE: This setting will over-ride any texture stage interpolation set for shaders using the function texture_set_interpolation_ext.


Example:

if global.Smoothing
   {
   texture_set_interpolation(true);
   }
else
   {
   texture_set_interpolation(false);
   }

The above code will turn interpolation on or off depending on the value of a global variable.


Back: Drawing
Next: texture_set_interpolation_ext
© Copyright YoYo Games Ltd. 2018 All Rights Reserved