texture_set_repeat

Indicates whether to use texture repeats.

Syntax:

texture_set_repeat(repeat);


Argument Description
repeat Turn texture repeats on (true) or off (false)


Returns: N/A


Description

This function can be used to indicate to GameMaker: Studio whether textures should repeat (true) or not (false) when used for models and primitives. Normally texture widths and heights lie in the range 0 - 1, but if you specify a value larger than 1 by default the rest is not drawn (the entire texture will be drawn with an "empty" section corresponding to the percentage over 1 that is used. So a value of 2 for a texture width or height would draw the texture in half the space and leave the other half empty). However, by using this function to set repeat to true the texture is repeated automatically over all models and primitives.

NOTE: Sprites and backgrounds are always drawn without repeating, so once you draw a sprite or background this value is reset to false. This default behaviour will not affect texture stage settings (ie: calling the function will, but the internal setting to false will not).

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


Example:

if global.Repeat
   {
   texture_set_repeat(true);
   }
else
   {
   texture_set_repeat(false);
   }

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


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