Fix: Drag-Icon in hud.gd auf 48x48 begrenzt (Slot zu Slot)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
341cc491fc
commit
6d3ef11321
1 changed files with 5 additions and 4 deletions
9
hud.gd
9
hud.gd
|
|
@ -141,9 +141,7 @@ func _start_actionbar_drag(slot_index: int):
|
|||
return
|
||||
drag_icon = TextureRect.new()
|
||||
drag_icon.texture = current_texture
|
||||
drag_icon.custom_minimum_size = Vector2(40, 40)
|
||||
drag_icon.size = Vector2(40, 40)
|
||||
drag_icon.expand_mode = TextureRect.EXPAND_FIT_WIDTH_PROPORTIONAL
|
||||
drag_icon.expand_mode = TextureRect.EXPAND_IGNORE_SIZE
|
||||
drag_icon.stretch_mode = TextureRect.STRETCH_KEEP_ASPECT_CENTERED
|
||||
drag_icon.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||
var drag_layer = CanvasLayer.new()
|
||||
|
|
@ -151,7 +149,10 @@ func _start_actionbar_drag(slot_index: int):
|
|||
drag_layer.layer = 200
|
||||
drag_layer.add_child(drag_icon)
|
||||
get_tree().root.add_child(drag_layer)
|
||||
drag_icon.position = get_viewport().get_mouse_position() - Vector2(20, 20)
|
||||
# Größe erst nach add_child setzen
|
||||
drag_icon.custom_minimum_size = Vector2(48, 48)
|
||||
drag_icon.size = Vector2(48, 48)
|
||||
drag_icon.position = get_viewport().get_mouse_position() - Vector2(24, 24)
|
||||
|
||||
func _process(_delta):
|
||||
if drag_from_slot >= 0 and drag_icon:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue