martinhowarth / shimmer Goto Github PK
View Code? Open in Web Editor NEWCreate games in python, without hassle - batteries included!
License: MIT License
Create games in python, without hassle - batteries included!
License: MIT License
In InstructionDisplay
we blat over the methods - we should make it call both the original method (if any) and the extra mask methods:
self.instruction.on_execute_start = self.show_mask
self.instruction.on_execute_complete = self.hide_mask
Just an easy way to attach a draggable anchor to something
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
Draggable and has a close button.
Font already exists, just got to add it to ButtonDefinition and use it in Button
With anchor on either cursor or on target.
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.
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)
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.
Builds on #47
Seems like fun to make!
Need to identify key constraints that make the system interesting. e.g.
features:
Thoughts:
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.
Current implementation is just a toy. now that we have a decent front end, make the backend better.
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.
Requires pop up boxes to be implemented first
Needs consistent interface for layouts. E.g width, height
Also make CI publish automatically on tags
Needs #40 to work with multiple layouts at once
E.g. for speech bubbles
Requires pop ups to be added first
With anchor on either cursor or on target.
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.
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??
e.g. to stop something being dragged outside of a defined area.
Needs:
Might be able to import this from somewhere else?
e.g. snap to grid
There isn't anything special about a background - shouldn't be in the base class.
Think this is easy for the visual elements - just ask Cocos to change z index.
However, events handlers are called in reverse order they were added, so need to fix that - Cocos doesn't seem to provide that behaviour natively.
Can't test what they look like; but can test that they respond to mouse / keyboard events correctly.
Probably want some way to record mouse events from a manual run to use as input for an automated on to make it easier to define them.
Simple wrapper to attach / remove a speech bubble (a TextBox) to a CocosNode.
Triggers to remove the bubble:
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.
Should just be a case of defining a pytest test gatherer that detects if the run_gui
fixture is being used.
Should split into more issues once I know what is needed, but something like:
Examples / supported use cases
Performance enhancement.
Something to keep track of box positions and search through them to find which to send mouse events to.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.