Created
April 11, 2023 13:22
-
-
Save brettchalupa/4dd3107163da29a8158c3cdb4974d521 to your computer and use it in GitHub Desktop.
Godot 4 Frames Per Second Explained
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extends Node2D | |
const FPS_DICTIONARY = { | |
0: 0, | |
1: 60, | |
2: 30, | |
} | |
func _ready() -> void: | |
set_max_fps_text() | |
func set_max_fps_text(): | |
$MaxFPS.text = "Max FPS: " + str(Engine.max_fps) | |
func _process(delta: float) -> void: | |
$CurrentFPS.text = "Current FPS: " + str(Engine.get_frames_per_second()) | |
func _on_fps_dropdown_item_selected(index: int) -> void: | |
Engine.max_fps = FPS_DICTIONARY[index] | |
set_max_fps_text() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment