X Tutup
Skip to content

dragonforge-dev/dragonforge-user-interface

Repository files navigation

Static Badge License GitHub release badge GitHub code size in bytes

Dragonforge User Interface Screen Icon

A user interface autoload singleton to handle UI screens for a game.

Version 0.2.1

For use with Godot 4.6-stable and later.

Dependencies

This plugin has no dependencies that are required for the code to work.

Installation Instructions

  1. Copy all the dragonforge_user_interface folder from the addons folder into your project's addons folder.
  2. Optionally copy the dragonforge_disk and dragon_forge_sound folders from the addons folder into your project's addons folder (if you want the button click sound to work).
  3. In your project go to Project -> Project Settings...
  4. Select the Plugins tab.
  5. Check the On checkbox under Enabled for Dragonforge User Interface
  6. Optionally check the On checkbox under Enabled for Dragonforge Disk (must be enabled before the Sound plugin or you will get errors).
  7. Optionally check the On checkbox under Enabled for Dragonforge Sound.
  8. Press the Close button.
  9. Save your project.

Usage Instructions

This is intended to be used with the - Dragonforge Game Template

Testing

Pressing the Run Project (F5) button will run the test project. All the splash screens will display. You will then get two screens, each with a button that loads the other screen.

Splash Screens

Three splash screens are included in the addons folder under splash_screens. Two animated Godot logo video versions, and the Dragonforge Dev splash screen using an AnimationPlayer. All the other examples can be found in res://ui/splash_screens/ under their respectively named folders. All splash screen assets are stored with their splash screen to make copying, adding, or removing screens easy to do from a project.

Class Descriptions

Screen Screen Icon

A default screen that is tracked by the UI autoload. All buttons in the screen are automatically hooked up to play the click sound set up in the Sound autoload. It also allows you to set a default control for when the screen loads, and tracks the last button pressed for when a player returns to this screen.

Export Variables

  • default_focused_control: Control The control that receives focus by default when starting.

Splash Screen Splash Screen Icon

A screen for display upon starting the game. Typically either plays a video or an animation. The sound can optionally be muted if you want to play one contiguous opening theme.

Signals

  • signal splash_complete Indicates that this splash screen is done playing. Tied directly to the display_time export variable.

Export Variables

  • mute_sound: bool = false Check this to turn off splash screen sound to allow the playing of theme music on startup.
  • display_time: float = 1.0 The amount of time the splash screen should be shown. Ignored if either [member video_player] or [member animation_player] have values, instead waiting for their finished signal.
  • video_player: VideoStreamPlayer If a VideoStreamPlayer is placed here, it will automatically be run. Ignored if left blank.
  • animation_player: AnimationPlayer If an AnimationPlayer is placed here, it will automatically play the "Show" animation. Ignored if left blank.

UI (Autoload)

The UI autoload scene.

Public Functions

  • register_screen(screen: Screen) -> void Registers a new screen to the UI autoload ensuring only one screen at a time is open. (Used by the Screen object.)
  • open_screen(screen: Screen) -> void Opens a new Screen and closes the currently open screen.
  • open_screen_by_name(screen_name: String) -> void Opens a new Screen by the screen's name and closes the currently open screen.
  • open_pop_up_by_name(screen_name: String) -> void Opens a new Screen by the screen's name without closing the currently open screen.
  • close_screen_by_name(screen_name: String) -> void Closes a Screen by the screen's name.

About

A user interface autoload singleton to handle UI screens for a game.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

X Tutup