Post Game jam commit
This commit is contained in:
commit
6db2131520
164 changed files with 172524 additions and 0 deletions
36
scripts/singletons/settings.gd
Normal file
36
scripts/singletons/settings.gd
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
extends Node
|
||||
|
||||
var master_volume: float = 1.0
|
||||
var fullscreen: bool = false
|
||||
var vsync : bool = false
|
||||
var max_fps: int = 60
|
||||
|
||||
func apply_volume():
|
||||
var bus_index := AudioServer.get_bus_index("Master")
|
||||
AudioServer.set_bus_volume_db(
|
||||
bus_index,
|
||||
linear_to_db(master_volume)
|
||||
)
|
||||
|
||||
func apply_fullscreen():
|
||||
DisplayServer.window_set_mode(
|
||||
DisplayServer.WINDOW_MODE_FULLSCREEN if fullscreen
|
||||
else DisplayServer.WINDOW_MODE_WINDOWED
|
||||
)
|
||||
if not fullscreen:
|
||||
get_window().size = Vector2i(480*3, 270*3);
|
||||
|
||||
func apply_vsync():
|
||||
DisplayServer.window_set_vsync_mode(
|
||||
DisplayServer.VSYNC_ENABLED if vsync
|
||||
else DisplayServer.VSYNC_DISABLED
|
||||
)
|
||||
|
||||
func apply_max_fps():
|
||||
Engine.max_fps = max_fps
|
||||
|
||||
func apply_all():
|
||||
apply_volume()
|
||||
apply_fullscreen()
|
||||
apply_vsync()
|
||||
apply_max_fps()
|
||||
Loading…
Add table
Add a link
Reference in a new issue