Code Monkey home page Code Monkey logo

shimmer's Introduction

Shimmer

Actions Status License: MIT PyPI Downloads Code style: black

Hello!

Testing

The following command should be used to run the tests:

poetry run pytest tests

For tests where a window is displayed, read the test description and press Y or N to pass or fail the test. This is intended to allow humans to validate that components look and behave as expected.

Most components have non-graphical testing as well that covers the event handling, but that is no replacement for a real human deciding whether it looks and feels good!

Running all non-graphical tests.

Set SKIP_GUI_TESTS=1 in your environment to skip graphical tests.

This skips all tests that require a GUI and user interaction.

shimmer's People

Contributors

martinhowarth avatar semantic-release-bot avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

shimmer's Issues

Add focusable box

This is a possible solution for #39. Some overlap with the z based event system issue as well.

This box has a focusable attribute. Only one box can be focused at once, and there is a global stack of focused ordering (e.g. one with current focus disappears, so the next one down gets focus automatically).

One way to take focus is by clicking on the box - c.f. overlapping windows.

Possible effects:

  • makes focused thing appear on top (high visual z index)

  • For any mouse event within the box, only it and it's children are allowed to handle them

  • need special case for drag event? Because can drag off the box, c.f. special handling in drag anchor

  • the focus box and its children get first dibs on keyboard events, but do not capture all of them

  • need to consider whether the children event handlers are removed from the global director event system if they are part of a focus group. This would stop them being called twice if the focus box handles passing the events down??

Allow user-defined mouse events to choose whether to capture events

Currently the MouseBox calls the defined methods and always returns True if there was one defined.

Could make it so that user functions can return None (as current) or True/False to determine whether to consume the event, or let it continue.

Default should be to consume it (i.e. if return None, treat that as a return True)

Make easy method to synchronously ask user for input

We have dialogs that give a pop up window with a question. That triggers a callback on answer. It would be good to present a simple synchronous way to do this so people can get started very simply without messing with callbacks.

Add drag-to-resize anchor/widget

Should be straightforward to add something simple here; but I think the interface for dynamically changing the size of Boxes isn't great right now so this is larger than it first appears as we should make that better too.

Make README awesome.

  • Snazzy example of how to use this library
  • Pictures/gifs of examples
  • Links to wiki
  • Links to how to use poetry
  • how to get involved / contribute
  • flag that this is a very new project

Add logistics system

Builds on #47

Seems like fun to make!

Need to identify key constraints that make the system interesting. e.g.

  • warehouse capacity
  • cargo capacity
  • cargo speed

features:

  • custom restrictions on what gets stored where
  • custom restrictions on what can carry which cargo
  • custom priorities for certain tasks

Thoughts:

  • might tie into a wider "task" system for a set of workers.
  • have to account for loss of sources/sinks with in-transit cargo.
  • have to account for pending deliveries to prevent (or minimise, doesn't have to be exact) double delivery.

Optimise adding Box event handlers if no actions defined

Currently Boxes register for many events, even if they don't implement them all - this will impact perf.

Easy option is to add a "freeze definition" option which disables handlers Which aren't used in the definition. Probably not worth supporting dynamic updates of definitions to automatically change handlers, though could be s future enhancement.

Event system based on z index rather than added order

Cocos2d sends events to children based on reverse order they were added. This works, but isn't intuitive when compared to the drawing mechanism of having z layers.

This should probably turn into a PR to cocos2d.

Add keyboard input handling system

Should split into more issues once I know what is needed, but something like:

  • a key mapping options menu
  • able to define callback to happens on key press/release

Examples / supported use cases

  • Easy way / example to make that control a character / vehicle
  • moving between buttons in a multi choice buttons widget - which is kinda a menu

Make backend pauseable

Difficultly here is dealing with the async sleeps. Think it's resolvable by just seeing a global pause timer and re-sleeping for however long has passed.

Think that pause timer needs to be a time series, with method to calculate seconds paused since X. That makes it easy to determine how long to re-sleep for

Create fixed width box Grid

This is a box Grid that arranges boxes while accounting for their size. The current basic one just has a specified number of boxes per row which only looks good for boxes of the same size.

Want an arrangement which takes fixed width or height in pixels (the other implicit is infinite) and fills in as many boxes as possible per row/column while respecting spacing. Should also handle justifying to edges (right/centre/left/bottom/top) leaving extra space as needed so you end up with a nice square grid.

Add debug toggle that shows outlines of Box

I'm imagining a thin red outline for every Box.rect currently in the scene to aid debugging of visual layouts.

This might possibly get too cluttered for many Boxes / overlapping boxes.

Possible extension is to show/hide the outlines on hover - this helps distinguish boxes that aren't an exact overlap.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.