vsync.gd 256 B

1234567891011121314
  1. extends Button
  2. var vsync_on: bool = true
  3. func _ready():
  4. update_vsync()
  5. func _on_pressed():
  6. vsync_on = !vsync_on
  7. update_vsync()
  8. func update_vsync():
  9. DisplayServer.window_set_vsync_mode(vsync_on)
  10. set_text("on" if vsync_on else "off")