Skip to main content

GUI extension for the Python game library Arcade https://arcade.academy/

Project description

Build Status Documentation Status

GUI Library for Python Arcade

This project targets to offer simple to complex ui elements to use in games and software written with the Python Arcade library.

Some UI components were copied over to adjust and fix them.

This project could also end up in a PR to integrate within Arcade.

The vision - WIP

ArcadeGui enables you to build this UI in 15 minutes: Kenney 1 - UI Base Pack

Basic Components

UIView

Central class to manager the ui components. Converts on_ callback functions into events, so that UIElements just have to contain one method to interact with user input.

UIElement

A general interface of an UI element.

Examples

Examples providing an overview of features, there will be dedicated documentation soon.

Screenshots

Example with ID Screenshot

Features for first release

  • UILabel
    • Align with UITextBox
  • UIButton
  • Focused element tracked
  • ID reference system for UIElements
  • CI/CD
  • UITextBox
    • Basic setup
    • Emit event on ENTER
    • Scroll text with cursor
    • Set max length
  • UIElements emit own UIEvents
    • UIButton
    • UITextInput
  • FlatButtons (https://codepen.io/maziarzamani/full/YXgvjv)
  • UIImageButton
  • UITexturedInputBox (maybe include in UIInputBox)
  • Theme support
    • Load style from yaml
    • Parse arcade.color, hex and rgb
    • Introduce style classes
    • Style attributes can be set as global fallback under class globals
    • Use UIElement.id to lookup special style data
    • Use UIStyle in UIElements
      • UI3DButton
      • FlatButton
      • GhostFlatButton
      • UILabel
      • UIInputBox
      • UIImageButton (images)
      • Read font attributes from style
    • Provide different color styles
    • Overwrite properties on UIElement
  • Add documentation and doc strings (sphinx)
    • release notes
    • setup sphinx
    • choose a sphinx theme
    • setup readthedocs
    • Document features
      • Quickstart
      • Interactions with ids
      • Styles
      • Style with id and classes
      • Implement own components
  • track new features and issues in Github

Roadmap to arcade 2.4

  • render textures, and draw UIElements using a SpriteList

Features for later

  • Add hierarchy for ui_elements
  • style classes can have effect on child elements
  • live refresh of loaded image
  • New UIElements
    • UITextArea
    • UIContainer supporting automatic positioning (row & column)
  • Layouting in general

Chores

  • improve docs
    • fix reference to examples
    • include screenshots (at least one)
  • support Python 3.7
  • test examples render the expected screen
  • separate button functionality from appearance
  • move theme resolve logic into UIElement (now called .parent_style())
  • make 3D Button more realistic, or change to flat buttons
  • harmonize constructors x, y vs center_x, center_y
  • fix hitbox of FlatButtons
  • add example for custom styles for all elements (perfect for test coverage)
  • figure out, how UIView.find_by_id does not produce typing warnings

Thoughts on themes (now called style)

  • UIView should hold a UIStyle that is used by all components, added to this view
  • UIElements have a _style attribute to overwrite style properties
  • Maybe supporting a hierarchy would be nice

Background information and other frameworks

Decisions

  • UIView is central component
  • One UIStyle object per UIView
    seems to be easier to implement a live refresh later
  • UIStyle information can be loaded from file or set programmatically
  • Themes vs Style
    talking to my younger brother gave me the impression, that 'style' or 'design' are more understandable then 'theme'
  • Events vs o 'on_'-callbacks
    Implementing new UIElements is way easier (less typing) if there is a central on_event method.
    Furthermore subclassing of UIElements to add custom actions like butten is pressed feels not as easy as it should be, an alternative could have been a signal/slot mechanism like in QT

Reference Pygame GUI projects

Overview

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

arcade_gui-0.1.0a7.tar.gz (23.0 kB view details)

Uploaded Source

Built Distribution

arcade_gui-0.1.0a7-py3-none-any.whl (28.5 kB view details)

Uploaded Python 3

File details

Details for the file arcade_gui-0.1.0a7.tar.gz.

File metadata

  • Download URL: arcade_gui-0.1.0a7.tar.gz
  • Upload date:
  • Size: 23.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.8.1 Windows/10

File hashes

Hashes for arcade_gui-0.1.0a7.tar.gz
Algorithm Hash digest
SHA256 8669cb012e6f8ec9327b1962c4d1663e022122abbc52b834201e680a0b2d6518
MD5 ec14059ed0b7b81a51df7ddd0310638d
BLAKE2b-256 daf08c157db881a1eb25c336ef365198ae4ed0e1b4ba9b0537222eb6803cef9f

See more details on using hashes here.

File details

Details for the file arcade_gui-0.1.0a7-py3-none-any.whl.

File metadata

  • Download URL: arcade_gui-0.1.0a7-py3-none-any.whl
  • Upload date:
  • Size: 28.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.8.1 Windows/10

File hashes

Hashes for arcade_gui-0.1.0a7-py3-none-any.whl
Algorithm Hash digest
SHA256 1570cfa23f6f209c99f247475508d78088b2c5cfcb43505d00a91c5e6bf2e7fd
MD5 10a000fe6262fb440255b840abb96b6b
BLAKE2b-256 2aeb11d558d353e8819a65e15361ed45f963fceb7f9983363761e2bc9a76f866

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page