mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2025-01-13 06:11:12 +01:00
Document some Image methods can unlock it (making set_pixel
fail)
This commit is contained in:
parent
f3833e82ac
commit
b952bfcc36
@ -400,6 +400,13 @@
|
|||||||
img.unlock()
|
img.unlock()
|
||||||
img.set_pixel(x, y, color) # Does not have an effect
|
img.set_pixel(x, y, color) # Does not have an effect
|
||||||
[/codeblock]
|
[/codeblock]
|
||||||
|
[b]Note:[/b] Some image methods can leave the image unlocked, making subsequent [method set_pixel] calls fail unless the image is locked again. Methods potentially unlocking the image: [method blend_rect], [method blend_rect_mask], [method blit_rect_mask], [method convert], [method fill], [method fill_rect], [method get_used_rect], and [method rgbe_to_srgb].
|
||||||
|
[codeblock]
|
||||||
|
img.lock()
|
||||||
|
img.set_pixel(x, y, color) # Works
|
||||||
|
img.fill(color) # Unlocks the image
|
||||||
|
img.set_pixel(x, y, color) # Does not have an effect
|
||||||
|
[/codeblock]
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
<method name="set_pixelv">
|
<method name="set_pixelv">
|
||||||
@ -416,6 +423,13 @@
|
|||||||
img.unlock()
|
img.unlock()
|
||||||
img.set_pixelv(Vector2(x, y), color) # Does not have an effect
|
img.set_pixelv(Vector2(x, y), color) # Does not have an effect
|
||||||
[/codeblock]
|
[/codeblock]
|
||||||
|
[b]Note:[/b] Some image methods can leave the image unlocked, making subsequent [method set_pixelv] calls fail unless the image is locked again. Methods potentially unlocking the image: [method blend_rect], [method blend_rect_mask], [method blit_rect_mask], [method convert], [method fill], [method fill_rect], [method get_used_rect], and [method rgbe_to_srgb].
|
||||||
|
[codeblock]
|
||||||
|
img.lock()
|
||||||
|
img.set_pixelv(Vector2(x, y), color) # Works
|
||||||
|
img.fill(dcolor) # Unlocks the image
|
||||||
|
img.set_pixelv(Vector2(x, y), color) # Does not have an effect
|
||||||
|
[/codeblock]
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
<method name="shrink_x2">
|
<method name="shrink_x2">
|
||||||
|
Loading…
Reference in New Issue
Block a user