Brush Tool Update#10
Conversation
Everything works as expected technically. However, although the texture for the line is set up, it didn't work as expected. Round texture doesn't appear at all, and square textures are like normal lines. It's probably caused by the logic of adding lines to Canvas. The following functions work well: 1 editing thickness 2 change color To test out these functions, you can set the texture to either square or semi-square. Circle texture can't print anything for unknown reasons.
Problem Fixed. All implemented features in the brush menu work well.
jordanbrotherton
left a comment
There was a problem hiding this comment.
Thanks for the contribution! I think a lot of it is really well implemented and the way you went about it was good, particularly the way you used tabs for the tool itself! There are a few things that should be addressed however. There are some comments through the code, and a few bigger ones are here:
- The options tab container shouldn't be directly in the EditExtras scene, instead it should be a separate scene with an instance of it placed inside the ToolManager scene. The way EditExtras is laid out with the managers should be a good reference to follow.
- Similarly, the brush settings view should be in its own separate scene as well, being its own scene in the brush directory and placed inside the ToolManager. This keeps everything compartmentalized and reduces potential conflicts.
- The brush textures don't play well with Line2D, being a leftover from when the brush tool acted as stamps. The brush presets should instead be a custom Resource script consisting of Line2D settings that replicate what the textures try to do. Additionally, they should not be hardcoded, with the brushes being dynamically added.
- Be sure to check your code follows the GDScript guidelines with gdlint.
| @onready var thick_sldr = $VBoxContainer/HBoxContainer/BrushSetting/TkSldrContainer/ThicknessSlider | ||
| @onready var hard_sldr = $VBoxContainer/HBoxContainer/BrushSetting/HdSldrContainer/HardnessSlider | ||
| @onready var color_picker = $VBoxContainer/HBoxContainer/ColorHeader/ColorPickerButton | ||
| @onready var brush_list = $VBoxContainer/BrushesHeader/BrushList |
There was a problem hiding this comment.
These should use @export and the values being set in the editor as it allows for scenes to change without breaking the hardcoded paths.
|
|
||
| # Called every frame. 'delta' is the elapsed time since the previous frame. | ||
| func _process(_delta: float) -> void: | ||
| pass |
There was a problem hiding this comment.
This unused function should be removed.
| ] | ||
|
|
||
| # Called when the node enters the scene tree for the first time. | ||
| func _ready() -> void: |
There was a problem hiding this comment.
There should be a default brush chosen, as currently no brush is chosen on startup, leading to nothing being drawn.
|
Looks good! Thanks for your contribution! |
Everything works as expected technically.
The following functions work well:
1 editing thickness
2 change color
3 change brush