openpatch / scratch-for-java

A library to ease the transition from Scratch to Java
http://scratch4j.openpatch.org/
MIT License
15 stars 6 forks source link

Extension camera #10

Closed mikebarkmin closed 11 months ago

mikebarkmin commented 1 year ago

There are a few things which do not work with the current implementation of the camera. Here is a list:

Basically, everything which draws to the foreground or background buffer does only work if the drawing should not persist.

I think there is no good workaround, since we would need an infinite canvas to draw on. So this might be a won't fix and should be added to the documentation. Currently, we're only drawing on a canvas, which has the same size as the window. Therefore, drawings from the past are not translated to the updated camera position. New drawings use the updated camera position, and thus this does work with the Tiled extension and the stampToForeground and stampToBackground methods.

Since the camera can also be used to zoom in and out, I added a new attribute to the sprite and text objects isUI. If this attribute is true, the object will ignore the camera.

I also updated the tiled and donut io examples to make use of the new camera extension.

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
scratch-for-java ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 26, 2023 4:09pm