The 9 Slice/9 Patch UI Desperately Needs Changing #12619
SolventMercury
started this conversation in
Editor
Replies: 1 comment
-
9slice should be deprecated in favor of using a theme. You can also use a 9slice with a 2Dnode by overriding the draw function and drawing a stylebox and export to edit it. extends Node2D
@export var my_stylebox : StyleBoxTexture
func _draw() -> void:
draw_style_box(my_stylebox, get_rect()) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
For context, I'm a somewhat new Godot user transferring over from GameMaker. One feature that GameMaker has for its sprites is 9 slicing, and I use it all the time! However, Godot's UI is significantly more confusing and difficult to use, and is inadequate compared to the very straightforward and flexible system for setting a 9-slice in GameMaker.
In GameMaker, 9 slice is a property of the sprite itself, not any kind of object or node. When you click the 9 slice tab of the sprite editor, the editor window goes into "9 slice mode", which looks like this:
On the left margin, you see the sprite's numerical properties, and a checkbox labeled "Activate Nine Slice", which toggles whether the property is enabled in the engine when the actual game is running. The left image allows you to move a set of guides over the sprite in question to define where the slice should occur. Lastly, the right image gives you a preview of what the 9 slice looks like. The sprite can have its edges dragged around and scaled, giving a live preview of what the effect will look like at various sizes. The desired result, obtained only through moving the guides, looks like this:
Godot's 9 patch UI is not only inferior, but its design was almost precision-engineered to betray my prior instincts. I spent quite a while mistakenly trying to set up my nineslice in the region editor, expecting it to work just like the graphical interface in GameMaker where you set your slice points by moving a set of lines. The terminology that Godot uses - patches instead of slices - also greatly magnified this issue. Removed from their context in Godot, the words "patch" and "region" are essentially synonymous, so it was easy for me to confuse the two.
My initial suggestions are as follows:
Beta Was this translation helpful? Give feedback.
All reactions