mirror of
https://github.com/godotengine/godot
synced 2024-10-05 00:24:24 +00:00
Merge pull request #47242 from sygi/bitmap-opaque-polygons
Bitmap opaque_to_polygons documentation
This commit is contained in:
commit
243be93087
|
@ -71,6 +71,12 @@
|
||||||
<argument index="1" name="epsilon" type="float" default="2.0">
|
<argument index="1" name="epsilon" type="float" default="2.0">
|
||||||
</argument>
|
</argument>
|
||||||
<description>
|
<description>
|
||||||
|
Creates an [Array] of polygons covering a rectangular portion of the bitmap. It uses a marching squares algorithm, followed by Ramer-Douglas-Peucker (RDP) reduction of the number of vertices. Each polygon is described as a [PackedVector2Array] of its vertices.
|
||||||
|
To get polygons covering the whole bitmap, pass:
|
||||||
|
[codeblock]
|
||||||
|
Rect2(Vector2(), get_size())
|
||||||
|
[/codeblock]
|
||||||
|
[code]epsilon[/code] is passed to RDP to control how accurately the polygons cover the bitmap: a lower [code]epsilon[/code] corresponds to more points in the polygons.
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
<method name="set_bit">
|
<method name="set_bit">
|
||||||
|
|
Loading…
Reference in a new issue