1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-31 15:39:49 +00:00
Pixelorama/Prefabs/PatternButton.gd
OverloadedOrama 768a1e7b8f Added Patterns for the bucket tool
The bucket tool can now use Patterns instead of colors to fill areas. They get loaded from the "Patterns" folder, similar to how Brushes and Palletes work. You can no longer use brushes for the bucket tool.
2020-04-25 00:42:02 +03:00

23 lines
572 B
GDScript

extends TextureButton
var image : Image
var texture : ImageTexture
func _ready():
if image:
texture = ImageTexture.new()
texture.create_from_image(image, 0)
func _on_PatternButton_pressed() -> void:
if Global.pattern_window_position == "left":
Global.pattern_left_image = image
Global.left_fill_pattern_container.get_child(0).get_child(0).texture = texture
elif Global.pattern_window_position == "right":
Global.pattern_right_image = image
Global.right_fill_pattern_container.get_child(0).get_child(0).texture = texture
Global.patterns_popup.hide()