.. Generated automatically by doc/tools/makerst.py in Godot's source tree. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead. .. _class_StyleBoxImageMask: StyleBoxImageMask ================= **Inherits:** :ref:`StyleBox` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` **Category:** Core Brief Description ----------------- Image mask based StyleBox, for mask test. Member Functions ---------------- +----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`get_expand` **(** **)** const | +----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_expand_margin_size` **(** :ref:`int` margin **)** const | +----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Image` | :ref:`get_image` **(** **)** const | +----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_expand` **(** :ref:`bool` expand **)** | +----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_expand_margin_size` **(** :ref:`int` margin, :ref:`float` size **)** | +----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_image` **(** :ref:`Image` image **)** | +----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ Description ----------- This StyleBox is similar to :ref:`StyleBoxTexture`, but only meant to be used for mask testing. It takes an image and applies stretch rules to determine if the point clicked is masked or not. Member Function Description --------------------------- .. _class_StyleBoxImageMask_get_expand: - :ref:`bool` **get_expand** **(** **)** const Return whether the expand property is set(default). When expanding, the image will use the same rules as :ref:`StyleBoxTexture` for expand. If not expanding, the image will always be tested at its original size. .. _class_StyleBoxImageMask_get_expand_margin_size: - :ref:`float` **get_expand_margin_size** **(** :ref:`int` margin **)** const Return the expand margin size (from enum MARGIN\_\*). Parts of the image below the size of the margin (and in the direction of the margin) will not expand. .. _class_StyleBoxImageMask_get_image: - :ref:`Image` **get_image** **(** **)** const Return the image used for mask testing. (see :ref:`set_image`). .. _class_StyleBoxImageMask_set_expand: - void **set_expand** **(** :ref:`bool` expand **)** Set the expand property (default). When expanding, the image will use the same rules as :ref:`StyleBoxTexture` for expand. If not expanding, the image will always be tested at its original size. .. _class_StyleBoxImageMask_set_expand_margin_size: - void **set_expand_margin_size** **(** :ref:`int` margin, :ref:`float` size **)** Set an expand margin size (from enum MARGIN\_\*). Parts of the image below the size of the margin (and in the direction of the margin) will not expand. .. _class_StyleBoxImageMask_set_image: - void **set_image** **(** :ref:`Image` image **)** Set the image used for mask testing. Pixels (converted to grey) that have a value, less than 0.5 will fail the test.