Custom brushes, crop image, split screen, about menu & asset re-organizing

- Added support for custom brushes. When you Ctrl-C a selection, it gets added to the list of custom brushes. Each mouse button can have a different brush, and the user can choose whether their color comes from the brush itself or the selected color in the tool options. They can also be resized based on the selected brush size.
- Custom brushes are also being saved on .pxo files.
- You can now crop images (per frame). All layers of that frame are taken into account and are affected.
- Added split screen support. The user can toggle between single screen and split screen, where a second canvas is being shown. Note that you cannot draw on the second canvas.
- Added an About Pixelorama selection on the new Help menu.
- Project assets are re-organized.
This commit is contained in:
OverloadedOrama 2019-09-25 22:59:48 +03:00
parent 62b9278537
commit 4e4a526332
27 changed files with 659 additions and 150 deletions

View file

@ -2,16 +2,22 @@ extends Camera2D
var zoom_min := Vector2(0.005, 0.005)
var zoom_max := Vector2.ONE
var viewport_container : ViewportContainer
var drag := false
func _ready() -> void:
viewport_container = get_parent().get_parent()
func _input(event) -> void:
if Global.can_draw && Global.has_focus:
if event.is_action_pressed("camera_drag"):
drag = true
elif event.is_action_released("camera_drag"):
drag = false
elif event.is_action_pressed("zoom_in"): # Wheel Up Event
var mouse_pos := viewport_container.get_local_mouse_position()
var viewport_size := viewport_container.rect_size
if event.is_action_pressed("camera_drag"):
drag = true
elif event.is_action_released("camera_drag"):
drag = false
if Global.can_draw && Global.has_focus && Rect2(Vector2.ZERO, viewport_size).has_point(mouse_pos):
if event.is_action_pressed("zoom_in"): # Wheel Up Event
zoom_camera(-1)
elif event.is_action_pressed("zoom_out"): # Wheel Down Event
zoom_camera(1)
@ -27,5 +33,5 @@ func zoom_camera(dir : int) -> void:
if zoom > zoom_max:
zoom = zoom_max
Global.zoom_level_label.text = "Zoom: x%s" % [stepify(1 / zoom.x, 0.01)]
if name == "Camera2D":
Global.zoom_level_label.text = "Zoom: x%s" % [stepify(1 / zoom.x, 0.01)]