2
0

class_svgtexture.rst 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/SVGTexture.xml.
  6. .. _class_SVGTexture:
  7. SVGTexture
  8. ==========
  9. **Inherits:** :ref:`Texture2D<class_Texture2D>` **<** :ref:`Texture<class_Texture>` **<** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. A scalable :ref:`Texture2D<class_Texture2D>` based on an SVG image.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. A scalable :ref:`Texture2D<class_Texture2D>` based on an SVG image. **SVGTexture**\ s are automatically re-rasterized to match font oversampling.
  15. .. rst-class:: classref-reftable-group
  16. Properties
  17. ----------
  18. .. table::
  19. :widths: auto
  20. +-------------------------------------+---------------------------------------------------------+----------------------------------------------------------------------------------------+
  21. | :ref:`float<class_float>` | :ref:`base_scale<class_SVGTexture_property_base_scale>` | ``1.0`` |
  22. +-------------------------------------+---------------------------------------------------------+----------------------------------------------------------------------------------------+
  23. | :ref:`Dictionary<class_Dictionary>` | :ref:`color_map<class_SVGTexture_property_color_map>` | ``{}`` |
  24. +-------------------------------------+---------------------------------------------------------+----------------------------------------------------------------------------------------+
  25. | :ref:`bool<class_bool>` | resource_local_to_scene | ``false`` (overrides :ref:`Resource<class_Resource_property_resource_local_to_scene>`) |
  26. +-------------------------------------+---------------------------------------------------------+----------------------------------------------------------------------------------------+
  27. | :ref:`float<class_float>` | :ref:`saturation<class_SVGTexture_property_saturation>` | ``1.0`` |
  28. +-------------------------------------+---------------------------------------------------------+----------------------------------------------------------------------------------------+
  29. .. rst-class:: classref-reftable-group
  30. Methods
  31. -------
  32. .. table::
  33. :widths: auto
  34. +-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  35. | :ref:`SVGTexture<class_SVGTexture>` | :ref:`create_from_string<class_SVGTexture_method_create_from_string>`\ (\ source\: :ref:`String<class_String>`, scale\: :ref:`float<class_float>` = 1.0, saturation\: :ref:`float<class_float>` = 1.0, color_map\: :ref:`Dictionary<class_Dictionary>` = {}\ ) |static| |
  36. +-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  37. | :ref:`String<class_String>` | :ref:`get_source<class_SVGTexture_method_get_source>`\ (\ ) |const| |
  38. +-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  39. | |void| | :ref:`set_size_override<class_SVGTexture_method_set_size_override>`\ (\ size\: :ref:`Vector2i<class_Vector2i>`\ ) |
  40. +-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  41. | |void| | :ref:`set_source<class_SVGTexture_method_set_source>`\ (\ source\: :ref:`String<class_String>`\ ) |
  42. +-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  43. .. rst-class:: classref-section-separator
  44. ----
  45. .. rst-class:: classref-descriptions-group
  46. Property Descriptions
  47. ---------------------
  48. .. _class_SVGTexture_property_base_scale:
  49. .. rst-class:: classref-property
  50. :ref:`float<class_float>` **base_scale** = ``1.0`` :ref:`🔗<class_SVGTexture_property_base_scale>`
  51. .. rst-class:: classref-property-setget
  52. - |void| **set_base_scale**\ (\ value\: :ref:`float<class_float>`\ )
  53. - :ref:`float<class_float>` **get_base_scale**\ (\ )
  54. SVG texture scale. ``1.0`` is the original SVG size. Higher values result in a larger image.
  55. .. rst-class:: classref-item-separator
  56. ----
  57. .. _class_SVGTexture_property_color_map:
  58. .. rst-class:: classref-property
  59. :ref:`Dictionary<class_Dictionary>` **color_map** = ``{}`` :ref:`🔗<class_SVGTexture_property_color_map>`
  60. .. rst-class:: classref-property-setget
  61. - |void| **set_color_map**\ (\ value\: :ref:`Dictionary<class_Dictionary>`\ )
  62. - :ref:`Dictionary<class_Dictionary>` **get_color_map**\ (\ )
  63. If set, remaps SVG texture colors according to :ref:`Color<class_Color>`-:ref:`Color<class_Color>` map.
  64. .. rst-class:: classref-item-separator
  65. ----
  66. .. _class_SVGTexture_property_saturation:
  67. .. rst-class:: classref-property
  68. :ref:`float<class_float>` **saturation** = ``1.0`` :ref:`🔗<class_SVGTexture_property_saturation>`
  69. .. rst-class:: classref-property-setget
  70. - |void| **set_saturation**\ (\ value\: :ref:`float<class_float>`\ )
  71. - :ref:`float<class_float>` **get_saturation**\ (\ )
  72. Overrides texture saturation.
  73. .. rst-class:: classref-section-separator
  74. ----
  75. .. rst-class:: classref-descriptions-group
  76. Method Descriptions
  77. -------------------
  78. .. _class_SVGTexture_method_create_from_string:
  79. .. rst-class:: classref-method
  80. :ref:`SVGTexture<class_SVGTexture>` **create_from_string**\ (\ source\: :ref:`String<class_String>`, scale\: :ref:`float<class_float>` = 1.0, saturation\: :ref:`float<class_float>` = 1.0, color_map\: :ref:`Dictionary<class_Dictionary>` = {}\ ) |static| :ref:`🔗<class_SVGTexture_method_create_from_string>`
  81. Creates a new **SVGTexture** and initializes it by allocating and setting the SVG data from string.
  82. .. rst-class:: classref-item-separator
  83. ----
  84. .. _class_SVGTexture_method_get_source:
  85. .. rst-class:: classref-method
  86. :ref:`String<class_String>` **get_source**\ (\ ) |const| :ref:`🔗<class_SVGTexture_method_get_source>`
  87. Returns SVG source code.
  88. .. rst-class:: classref-item-separator
  89. ----
  90. .. _class_SVGTexture_method_set_size_override:
  91. .. rst-class:: classref-method
  92. |void| **set_size_override**\ (\ size\: :ref:`Vector2i<class_Vector2i>`\ ) :ref:`🔗<class_SVGTexture_method_set_size_override>`
  93. Resizes the texture to the specified dimensions.
  94. .. rst-class:: classref-item-separator
  95. ----
  96. .. _class_SVGTexture_method_set_source:
  97. .. rst-class:: classref-method
  98. |void| **set_source**\ (\ source\: :ref:`String<class_String>`\ ) :ref:`🔗<class_SVGTexture_method_set_source>`
  99. Sets SVG source code.
  100. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  101. .. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
  102. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  103. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  104. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  105. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  106. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  107. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  108. .. |void| replace:: :abbr:`void (No return value.)`