Line_SetTextureOffset

From ZDoom Wiki
Jump to navigation Jump to search

53:Line_SetTextureOffset (lineid, x, y, side, flags)


Usage

Changes the offset of a texture at run-time. This can be used during runtime for special effects, and it is possible to set the offsets of upper, mid, and lower textures seperately. This special cannot be used directly on a line in the map, but must be called from an ACS script instead.

side can be SIDE_FRONT or SIDE_BACK.

x and y are fixed point values; using NO_CHANGE leaves it alone.

flags can be a combination of the following flags:

  • TEXFLAG_TOP (1): upper texture
  • TEXFLAG_MIDDLE (2): mid texture
  • TEXFLAG_BOTTOM (4): lower texture
  • TEXFLAG_ADDOFFSET (8): add to offset (as opposed to directly setting it)

Examples

This script will move the middle texture on a line with an id of 1 in a clockwise circular pattern.

script 1 OPEN
{
    int a, x, y;
    while(TRUE)
    {
        for(a=0; a<1.0; a+=512)
        {
            x = FixedMul(cos(a), 128.0);
            y = FixedMul(sin(a), 128.0);
            Line_SetTextureOffset(1, x, y, SIDE_FRONT, TEXFLAG_MIDDLE);
            delay(1);
        }
    }
}