Skip to content

diklor/advanced_radial_menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

advanced_radial_menu

Advanced radial menu node

icon

Usage video

https://ayanami.app/_iwkUXrU6

1.4 Big rewrite!

- !!! Changed: children are now located in clockwise order

  • Changed: animated_pulse_offset parameter works the opposite way (more logically). Negative values are offsetting inside the circle
  • Changed: Children rotation and scale are changed only once when:
    • Child added, removed or reordered
    • Radial menu visibility is changed (but you can use radial_menu.force_update())
    • Changed one of the following parameters: enabled, first_in_center, children_rotate
  • Added new parameter children_distance_offset - offsets children from the center
  • Added new parameter children_rotate_inverted - inverts children rotation (towards or away from center)
  • Removed parameter children_optimized. Children collection is not happening on every frame and optimized by default
  • Extremely optimized and more fast
  • More of static typing

1.3 Update

  • Temporary selections
  • Signal docs
  • .gdignore finally
  • Controller support and mouse detection fixes

Temporarily selection

Set

radial_menu.set_temporary_selection(1)
# (1 is second element, 0 is first)

Remove

radial_menu.set_temporary_selection(-2) # -2 is nothing

Signals

Connect slot selection

# Example how to make selected slot green
var _prev_slot: Control = null

func _ready() -> void:
  radial_menu.slot_selected.connect(func(slot: Control, index: int) -> void:
    if _prev_slot != null:
      _prev_slot.modulate = Color.WHITE
    slot.modulate = Color.GREEN
    _prev_slot = slot
  )

Selection changed (hover):

radial_menu.selection_changed.connect(func(new_selection: int) -> void:
	var slot := radial_menu.get_selected_child()
)
# You can animate `slot.scale` because radial_menu is not a container

Selection canceled:

radial_menu.selection_canceled.connect(func() -> void: ...

What the hell with indexes?

  • -2 is nothing
  • -1 is center slot (only if you have first_in_center variable enabled)
  • 0 is first slot

It's just ordinary indexes, but -1 became -2

If you work with a team, you should probably comment these incomprehensible -2 indexes in the code...

What is deadzone?

What is deadzone?

deadzone.jpg

The threshold of detection. For example, in the picture of the deadzone is 0.2, means the values ​​below or equals 0.2 will be ignored

Download example.tscn (downgit)

Support

Buy Me A Coffee

About

No description or website provided.

Topics

Resources

License

Stars

59 stars

Watchers

3 watching

Forks

Packages

 
 
 

Contributors