Line_SetTextureScale

From ZDoom Wiki
Jump to: navigation, search

56:Line_SetTextureScale (lineid, x, y, side, flags)


Usage

Changes the scale of a texture at run-time. This can be used during runtime for special effects, and it is possible to set the scales of upper, mid, and lower textures separately. This special cannot be used directly on a line in the map, but must be called from an ACS script instead. If you are using the UDMF format and do not intend to adjust texture scales later on, you can use the native scaling features located under the sidedefs custom tab.

side can be LINE_FRONT or LINE_BACK.

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

flags can be a combination of the following flags:

  • 1: upper texture
  • 2: mid texture
  • 4: lower texture
  • 8: apply to current scale (as opposed to directly setting it)

Examples

This example sets the lines with the matching line id into a sort of pulsing growing and shrinking pattern. It uses a scaled sin and cos wave pattern for the scale values. Wonky!

script 1 (int lineid)
{
  while (TRUE)
  {
    for (int angle=0; angle<1.0; angle+=0.01)
    {
      int x = 1.0 + cos(angle) / 4;
      int y = 1.0 + sin(angle) / 4;
      Line_SetTextureScale(lineid, x, y, SIDE_FRONT, 2);
      delay(1);
    }
  }
}