TerrainMaterialsPropertiesDialog

Package: Libraries.Interface.Controls.Scenes.Dialogs · Inherits from: Libraries.Interface.Events.TextChangeListener, Libraries.Interface.Controls.Control, Libraries.Interface.Forms.FormPrimitiveContainer, Libraries.Interface.Item, Libraries.Interface.Controls.Scenes.Dialogs.PropertiesDialog, Libraries.Interface.Item2D, Libraries.Language.Object, Libraries.Interface.Events.SelectionListener, Libraries.Interface.Controls.Dialog

The TerrainMaterialsPropertiesDialog is a selected terrain's Materials section: the ground layers it can be painted with. A new terrain has none, and its ground is plain. "Add material..." adds a layer from a material file, or from a texture set's color map or another image, for which a material file is written. The first layer covers the whole ground; the others show where they are painted, with the Paint tool in the Brush section. Each layer is a card titled with its name, holding its tile size and its buttons: "Choose..." to give it another material, "Remove", and "Details...". Two arrows on the title line move the layer up or down one place; the painting stays where it is, so the ground is drawn again with the materials in their new places. The blend softness, in its own card, is how softly texture set layers blend where they meet. A line above the cards says only what is worth saying, such as a missing material file. Adding, choosing and removing layers can be undone. It shows in the scene editor's Properties panel, between the terrain's facts and its brush.

Variables

  • integer FIND_MAPS
  • integer ADD: remove a layer.
  • integer MOVE_DOWN: the interface scale: two 24 pixel buttons and the space around them.
  • integer REMOVE: as Material's NORMAL_MAP), find maps by name, or make a set plain.
  • integer CLOSE_DETAILS
  • integer MAKE_PLAIN: Moving a layer up or down one place.
  • integer CHOOSE: remove a layer.
  • integer CHOOSE_MAP
  • integer CLEAR_MAP
  • integer MOVE_UP: Moving a layer up or down one place.
  • integer DETAILS: as Material's NORMAL_MAP), find maps by name, or make a set plain.

Actions

ButtonActivated(integer kind, integer layer)

This action is called by the section's buttons: it asks for a file to add a layer or choose a layer's material, or removes a layer.

Parameters

  • kind integer: ADD, CHOOSE, REMOVE, MOVE_UP or MOVE_DOWN, or a details button
  • layer integer: The layer, from 0, for CHOOSE and REMOVE

FieldLeft(Libraries.Interface.Controls.TextField field)

This action is called when the focus leaves one of the Material details' fields: the name, roughness or metallic is then taken. A number out of range is ignored.

Parameters

FocusField()

Moves the focus to the first layer's name, or to "Add material..." when there are none.

Refresh()

Shows the terrain's materials again, after one changed.

SelectionChanged(Libraries.Interface.Events.SelectionEvent event)

This action shows the dialog when a terrain is selected, and hides it otherwise.

Parameters

SetFields(Libraries.Interface.Controls.Scenes.Items.EditorItem item)

This action sets the fields from a selected terrain's highlight.

Parameters

SetTerrain(Libraries.Interface.Controls.Scenes.Items.EditorTerrain terrain)

This action shows a terrain's materials: a row for each layer, and the blend softness, or that it has none.

Parameters

SliderTaken(Libraries.Interface.Controls.TextField field)

A slider's value was finally changed, or a number typed in its field: the roughness or metallic is taken as when the focus leaves its field.

Parameters

TextChanged(Libraries.Interface.Events.TextChangeEvent event)

This action sets a layer's tile size, or the blend softness, as it is typed. Text that isn't a number, or is out of range, is ignored: a tile size from 0.25 to 63.75, and a softness from 0.01 to 1.

Parameters

Inherited Actions

263 actions from Libraries.Interface.Controls.Control
20 actions from Libraries.Interface.Controls.Dialog
34 actions from Libraries.Interface.Controls.Scenes.Dialogs.PropertiesDialog
8 actions from Libraries.Interface.Forms.FormPrimitiveContainer
57 actions from Libraries.Interface.Item
200 actions from Libraries.Interface.Item2D
3 actions from Libraries.Language.Object