class_styleboximagemask.rst 4.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead.
  3. .. _class_StyleBoxImageMask:
  4. StyleBoxImageMask
  5. =================
  6. **Inherits:** :ref:`StyleBox<class_stylebox>` **<** :ref:`Resource<class_resource>` **<** :ref:`Reference<class_reference>` **<** :ref:`Object<class_object>`
  7. **Category:** Core
  8. Brief Description
  9. -----------------
  10. Image mask based StyleBox, for mask test.
  11. Member Functions
  12. ----------------
  13. +----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
  14. | :ref:`bool<class_bool>` | :ref:`get_expand<class_StyleBoxImageMask_get_expand>` **(** **)** const |
  15. +----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
  16. | :ref:`float<class_float>` | :ref:`get_expand_margin_size<class_StyleBoxImageMask_get_expand_margin_size>` **(** :ref:`int<class_int>` margin **)** const |
  17. +----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
  18. | :ref:`Image<class_image>` | :ref:`get_image<class_StyleBoxImageMask_get_image>` **(** **)** const |
  19. +----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
  20. | void | :ref:`set_expand<class_StyleBoxImageMask_set_expand>` **(** :ref:`bool<class_bool>` expand **)** |
  21. +----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
  22. | void | :ref:`set_expand_margin_size<class_StyleBoxImageMask_set_expand_margin_size>` **(** :ref:`int<class_int>` margin, :ref:`float<class_float>` size **)** |
  23. +----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
  24. | void | :ref:`set_image<class_StyleBoxImageMask_set_image>` **(** :ref:`Image<class_image>` image **)** |
  25. +----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
  26. Description
  27. -----------
  28. This StyleBox is similar to :ref:`StyleBoxTexture<class_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.
  29. Member Function Description
  30. ---------------------------
  31. .. _class_StyleBoxImageMask_get_expand:
  32. - :ref:`bool<class_bool>` **get_expand** **(** **)** const
  33. Return whether the expand property is set(default). When expanding, the image will use the same rules as :ref:`StyleBoxTexture<class_styleboxtexture>` for expand. If not expanding, the image will always be tested at its original size.
  34. .. _class_StyleBoxImageMask_get_expand_margin_size:
  35. - :ref:`float<class_float>` **get_expand_margin_size** **(** :ref:`int<class_int>` margin **)** const
  36. 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.
  37. .. _class_StyleBoxImageMask_get_image:
  38. - :ref:`Image<class_image>` **get_image** **(** **)** const
  39. Return the image used for mask testing. (see :ref:`set_image<class_StyleBoxImageMask_set_image>`).
  40. .. _class_StyleBoxImageMask_set_expand:
  41. - void **set_expand** **(** :ref:`bool<class_bool>` expand **)**
  42. Set the expand property (default). When expanding, the image will use the same rules as :ref:`StyleBoxTexture<class_styleboxtexture>` for expand. If not expanding, the image will always be tested at its original size.
  43. .. _class_StyleBoxImageMask_set_expand_margin_size:
  44. - void **set_expand_margin_size** **(** :ref:`int<class_int>` margin, :ref:`float<class_float>` size **)**
  45. 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.
  46. .. _class_StyleBoxImageMask_set_image:
  47. - void **set_image** **(** :ref:`Image<class_image>` image **)**
  48. Set the image used for mask testing. Pixels (converted to grey) that have a value, less than 0.5 will fail the test.