summaryrefslogtreecommitdiff
path: root/doc/classes
diff options
context:
space:
mode:
authorreduz <reduzio@gmail.com>2021-06-17 11:30:20 -0300
committerreduz <reduzio@gmail.com>2021-06-17 12:42:27 -0300
commit94d31ac327a8fe6ff7c007b34cb25772bf96d17e (patch)
tree3321a44a246caed059a9baf38e21a3fe749dee6a /doc/classes
parent085e1d3c03497dec41ca86019e4850a4b78085e7 (diff)
Implement animation slice drawing in CanvasItem
* Added a function to ignore subsequent commands if they don't fall within the slice. * This will be used by the new TileMap to properly provide animated tiles.
Diffstat (limited to 'doc/classes')
-rw-r--r--doc/classes/CanvasItem.xml22
1 files changed, 22 insertions, 0 deletions
diff --git a/doc/classes/CanvasItem.xml b/doc/classes/CanvasItem.xml
index 87b157db4e..f15bc14be3 100644
--- a/doc/classes/CanvasItem.xml
+++ b/doc/classes/CanvasItem.xml
@@ -24,6 +24,21 @@
Overridable function called by the engine (if defined) to draw the canvas item.
</description>
</method>
+ <method name="draw_animation_slice">
+ <return type="void">
+ </return>
+ <argument index="0" name="animation_length" type="float">
+ </argument>
+ <argument index="1" name="slice_begin" type="float">
+ </argument>
+ <argument index="2" name="slice_end" type="float">
+ </argument>
+ <argument index="3" name="offset" type="float" default="0.0">
+ </argument>
+ <description>
+ Subsequent drawing commands will be ignored unless they fall within the specified animation slice. This is a faster way to implement animations that loop on background rather than redrawing constantly.
+ </description>
+ </method>
<method name="draw_arc">
<return type="void">
</return>
@@ -98,6 +113,13 @@
Draws a colored polygon of any amount of points, convex or concave.
</description>
</method>
+ <method name="draw_end_animation">
+ <return type="void">
+ </return>
+ <description>
+ After submitting all animations slices via [method draw_animation_slice], this function can be used to revert drawing to its default state (all subsequent drawing commands will be visible). If you don't care about this particular use case, usage of this function after submitting the slices is not required.
+ </description>
+ </method>
<method name="draw_line">
<return type="void">
</return>