TerrainRegionOutline

Package: Libraries.Game.Graphics.Worlds · Inherits from: Libraries.Interface.Item3D, Libraries.Interface.Item, Libraries.Language.Object, Libraries.Game.Graphics.Model

A TerrainRegionOutline shows a flat rectangle on a terrain, such as the region slot under the pointer, or a block of regions about to be added: an outline at one height, with a black edge, so it shows on light and dark ground. Its lines' color can change, such as green where regions can go and red where they can't. Call Place whenever the rectangle or its height changes. Its mesh is made once and then updated in place, as TerrainRampPreview's is. It doesn't cast shadows.

Example Code

use Libraries.Game.Graphics.Worlds.TerrainRegionOutline

TerrainRegionOutline outline
outline:Place(0, 0, 256, 256, 10)
outline:SetLineColor(0.15, 0.85, 0.25)

Actions

Place(number minimumX, number minimumZ, number maximumX, number maximumZ, number height)

This action places the outline around a rectangle, at a height.

Parameters

  • minimumX number: The rectangle's smallest x, in world units.
  • minimumZ number: The rectangle's smallest z, in world units.
  • maximumX number: The rectangle's largest x, in world units.
  • maximumZ number: The rectangle's largest z, in world units.
  • height number: The height the outline is drawn at, in world units.

SetLineColor(number red, number green, number blue)

This action sets the color of the outline's lines. The black edge stays black.

Parameters

  • red number: The red part, from 0 to 1.
  • green number: The green part, from 0 to 1.
  • blue number: The blue part, from 0 to 1.

Inherited Actions

112 actions from Libraries.Game.Graphics.Model
62 actions from Libraries.Interface.Item
211 actions from Libraries.Interface.Item3D
3 actions from Libraries.Language.Object