opts.gd 780 B

1234567891011121314151617181920212223242526272829303132
  1. extends VBoxContainer
  2. func _ready():
  3. $OptionButton.add_item('windowned')
  4. $OptionButton.add_item('borderless')
  5. $OptionButton.add_item('fullscreen')
  6. func _input(event):
  7. if Input.is_action_just_pressed("opts"):
  8. get_parent().visible = !get_parent().visible
  9. if Input.is_action_just_pressed("f12"):
  10. OS.window_fullscreen = !OS.window_fullscreen
  11. func _on_HSlider_value_changed(value):
  12. AudioServer.set_bus_volume_db(0,linear2db(value))
  13. pass # Replace with function body.
  14. func _on_OptionButton_item_selected(index):
  15. match index:
  16. 0:
  17. OS.window_fullscreen = false
  18. OS.window_borderless = false
  19. 1:
  20. OS.window_fullscreen = false
  21. OS.window_borderless = true
  22. 2:
  23. OS.window_fullscreen = true
  24. OS.window_borderless = false
  25. pass # Replace with function body.