mirror of
https://github.com/tonytins/CozyPixelStudio.git
synced 2025-12-15 23:34:43 -05:00
Changes to scripts to follow GDScript style guide
Please read here for more info: https://docs.godotengine.org/en/latest/getting_started/scripting/gdscript/gdscript_styleguide.html This commit does not add/change any new/existing features.
This commit is contained in:
parent
62bbad7374
commit
5a54235604
32 changed files with 295 additions and 165 deletions
|
|
@ -10,6 +10,7 @@ class SimpleDrawer extends Drawer:
|
|||
func reset() -> void:
|
||||
pass
|
||||
|
||||
|
||||
func set_pixel(_sprite: Image, _pos: Vector2, _new_color: Color) -> void:
|
||||
_sprite.set_pixel(_pos.x, _pos.y, _new_color)
|
||||
|
||||
|
|
@ -19,9 +20,11 @@ class PixelPerfectDrawer extends Drawer:
|
|||
const corners = [Vector2(1, 1), Vector2(-1, -1), Vector2(-1, 1), Vector2(1, -1)]
|
||||
var last_pixels = [null, null]
|
||||
|
||||
|
||||
func reset():
|
||||
last_pixels = [null, null]
|
||||
|
||||
|
||||
func set_pixel(_sprite: Image, _pos: Vector2, _new_color: Color) -> void:
|
||||
last_pixels.push_back([_pos, _sprite.get_pixel(_pos.x, _pos.y)])
|
||||
_sprite.set_pixel(_pos.x, _pos.y, _new_color)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue