Skip to content

MapLine

Type

MapLine

Represents a map linedef.

Inherits MapObject

All properties and functions of MapObject can be used in addition to those below.

Properties

Property Type Description
x1 float The X coordinate of the line's first vertex
y1 float The Y coordinate of the line's first vertex
x2 float The X coordinate of the line's second vertex
y2 float The Y coordinate of the line's second vertex
vertex1 MapVertex The line's first vertex
vertex2 MapVertex The line's second vertex
side1 MapSide The line's first (front) side
side2 MapSide The line's second (back) side
special integer The line's action special
length float The length of the line in map units

Constructors

No Constructors

This type can not be created directly in scripts.

See:

Functions

Overview

Info

Flag(flagName) -> boolean VisibleTextures() -> table

Modification

Flip([swapSides])


Flag

Parameters

  • flagName (string): The name of the flag to check

Returns

  • boolean: true if the given flag is set

Notes

If the parent Map's format is UDMF, this behaves exactly the same as MapObject.BoolProperty. Otherwise, flagName needs to be one of the following:

  • blocking
  • twosided
  • dontpegtop
  • dontpegbottom

VisibleTextures

Determines what textures (parts) of the line are showing.

Returns

  • table: A table containing the following boolean values:
    • frontUpper
    • frontMiddle
    • frontLower
    • backUpper
    • backMiddle
    • backLower

Example

local visible = line:VisibleTextures()

-- Check if front upper texture is visible
if visible.frontUpper == true then
    -- Check if texture is missing
    if line.side1.textureTop == '-' then
        App.LogMessage('Line front upper texture is missing')
    end
end

Flip

Flips the line so that it faces the opposite direction. If swapSides is true, side1 and side2 will also be swapped so that they stay on the same spatial "side" of the line.

Parameters

  • [swapSides] (boolean): Whether to swap the sides. Default is true