Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Discussion] Overlay API Design #268

Open
ShadowApex opened this issue Sep 29, 2023 · 0 comments
Open

[Discussion] Overlay API Design #268

ShadowApex opened this issue Sep 29, 2023 · 0 comments
Labels
core Core functionality proposal Issue to discuss feature implementation details
Milestone

Comments

@ShadowApex
Copy link
Collaborator

With the inclusion of #238, OpenGamepadUI now has an API that can allow developers to write their own overlays. This issue was opened in order to get input on the API design, as I can foresee a multitude of different ways people might want to write overlays. A big advantage to writing an OpenGamepadUI overlay is that we can leverage Godot's user interface nodes to make multiple overlays play nice with each other and not obscure each other's content.

A working overlay implementation is the Discord Overlay Plugin:

Requirements

Here are some proposed requirements for the overlay API:

  • Allow overlays to anchor themselves to a part of the screen and not overlap with other overlay content.
  • Allow overlays to be "unmanaged", where they can dictate their own layout.
  • Allow overlays to be visible on different layers, allowing some overlay content to overlap.

Nice-to-have features

  • Allow user to choose the overlay format for each overlay. (e.g. top-left align, center, etc.)

Implementation

The API implementation is defined in the OverlayProvider class. The OverlayContainer is responsible for arranging the OverlayProvider nodes in the appropriate way.

OverlayProvider

Properties

managed: bool - Whether or not the OverlayContainer should manage the overlay's layout. (Default: true)
layer: int - The layer that the overlay should be drawn on (Default: 0)

@ShadowApex ShadowApex added core Core functionality proposal Issue to discuss feature implementation details labels Sep 29, 2023
@ShadowApex ShadowApex added this to the v1.0.0 milestone Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Core functionality proposal Issue to discuss feature implementation details
Projects
None yet
Development

No branches or pull requests

1 participant