Comments (5)
There is currently basic support for animations. Take a look at Orbit.scala
in the examples. I have an immediate task to make this a lot better.
You can add multiple drawings to the same window with the current API, but it's not obvious how to do this unless you know the API in quite some depth. I'll look at making this easier, but it will happen after the animation improvements.
I don't have a reliable Internet connection at the moment so my responses will be delayed.
from doodle.
This would indeed be useful. Any update on this?
Reading the source code of Animation and Orbit, I couldn't find a easy way to display the animation with the Standard Interpreter. I'm planning to use Doodle to teach Scala. I'd like to stay away from the js backend, and rather stick to a regular, simple, Scala app.
Am I missing something?
Thanks
from doodle.
@ddemange The rough plan for animations is some kind of FRP system. Could probably build it out of existing parts, like fs2
or monix
, and a few changes to the backend.
What is your time frame, and what are teaching goals around animations?
from doodle.
@noelwelsh Sorry for the late reply.
I'd like to get ready for late october.
This is a course I adapt from a previous one, in which I was relying on Racket, and the universe.rkt teachpack. There, I could easily ask the students to write all the mechanics of the game, while I was taking care of providing the right call to big-bang and potential required conversions. I found universe/big-bang really smooth to use (and to explain to the students while not having to wave hands too much -- this is something I was not ashamed to show).
I don't have teaching goals around animations, per se. Rather, I see it as a way of doing entertaining program exercises. Having something similar to universe/big-bang would save me the re-coding of a whole GUI every time.
Perhaps a simple reactive framework -- limited to clock ticks -- would be enough for me. Something like a simple state monad, where at each step, the state would be "printed" as a doodle Image. Typical workflow:
- define the type State
- a conversion function show: State => Image
- a step function : State => State
- define a initial state init : State
- and the step function would be applied (starting from init) at every clock tic, re-showing the current State in the same single frame.
I can see in Orbit.scala some of the above elements, but I fail to see how to use this in the current version of doodle (typically, draw is opening a new Frame each time called).
from doodle.
In 0.9 you can draw
to a given Frame
, which allows animations and multiple images per frame. There is animation support, and the Reactor
package provides animations in a similar style to universe/big-bang and the reactors in Pyret.
from doodle.
Related Issues (20)
- Cleanup path handling
- Implement `flatMap` for `Picture`
- Add `boundingBox` syntax for `Size`
- Improve type inference HOT 1
- Add SVG documentation
- Parse hex strings into `Color`
- SVG must not fill open paths HOT 2
- Support perceptually-based color description
- Port minitest tests to munit
- Image saved to file does not have size of Frame HOT 1
- Question: How do we set a shape position relative to a Frame origin HOT 4
- Unexpected behaviour with `Picture` monad and Java2D renderer HOT 2
- BufferedImageConverter cleanup HOT 3
- Consistent naming of writers HOT 2
- Add tests for `BufferedImageWriter`
- Abstract default frame HOT 3
- Writer conveniences
- Java Implementation Cleanup
- Configurable delay between frames in animated GIF HOT 2
- Allow directly setting the width and height of the bounding box
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from doodle.