MarginContainer

Inherits: Container < Control < CanvasItem < Node < Object

Category: Core

Brief Description

Simple margin container.

Theme Properties

intmargin_bottom
intmargin_left
intmargin_right
intmargin_top

Description

Adds a top, left, bottom, and right margin to all Control nodes that are direct children of the container. To control the MarginContainer’s margin, use the margin_* theme properties listed below.

Note: Be careful, Control margin values are different than the constant margin values. If you want to change the custom margin values of the MarginContainer by code you should use the following examples:

  1. var margin_value = 100
  2. set("custom_constants/margin_top", margin_value)
  3. set("custom_constants/margin_left", margin_value)
  4. set("custom_constants/margin_bottom", margin_value)
  5. set("custom_constants/margin_right", margin_value)