-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[Load Anim] Add new animation #4093
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Updated the ChangeLog to clarify the conditions for rendering the 'Wipe' animation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request adds a new "Wipe B/W" loading animation that creates a sliding wipe effect across the screen using the background color. The PR also modifies the behavior when no loading image is defined, changing from erasing the .loading file to writing "NO" to it, and increments the version to 0.03.
Key Changes:
- Adds a new "Wipe B/W" animation option that uses a sliding rectangle effect
- Changes
.loadingfile handling to write "NO" instead of erasing when no loading image exists - Updates version from 0.02 to 0.03 and adds changelog entry
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| apps/loadanim/settings.js | Adds new "Wipe B/W" animation implementation and modifies saveBootAnim to write "NO" to .loading file instead of erasing it |
| apps/loadanim/metadata.json | Version bump from 0.02 to 0.03 |
| apps/loadanim/ChangeLog | Documents the addition of the new animation and the .loading file handling change |
Comments suppressed due to low confidence (1)
apps/loadanim/settings.js:90
- Avoid automated semicolon insertion (90% of all statements in the enclosing function have an explicit semicolon).
o.setColor(g.theme.bg2)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
| type:"EXEC", fn: () => { "ram"; | ||
| if (n>=176) { done(); return; } | ||
| n+=10; | ||
| o.fillRect(0,0,7+n,176); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you fillrect from n-3 to n+7? That way we're not wasting time filling a larger area that needed
| let o = Graphics.createArrayBuffer(176,176,2); | ||
| let n = 0, gl = g; | ||
| o.drawImage(g.asImage(),0,0); | ||
| o.setColor(g.theme.bg2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't work I'm afraid - you have 2 bit colour (4 shades of grey) so trying to set it to the 16 bit themes background colour will be effectively random. You're better off just setting to 0.
|
I don't really get what you're trying to do here. You want to copy the contents of the screen into a black and white image and then swipe across it to make it all one colour? For me, on the normal theme, it inverts the screen colours (white->black), and then swipes over in black which is hardly visible. It appears not to be converting the image to greyscale either, so you probably don't need a 2bpp image if that's what you're after, just 1bpp. If you just wanted to swipe over, couldn't you do like we did for the circle one and just use a transparent colour in the image, then you could keep the background full colour until it was swiped over? If you want to keep the previous contents all you have to do is remove the |
|
I think probably what you wanted is more like this? but even so, using transparency would allow colour unless you really wanted it to be made black and white |
|
Sorry, I am pretty inexperienced with overlays :( How would you go about setting areas transparent? In the docs it says |
|
might do it - it'll start off transparent (all 0) and then areas are filled with |
|
Thanks! Is there a way to tell whether loading is done? the |
Co-authored-by: Rob Pilling <[email protected]>
The done function from setTimeout(0) is called when the app has finished loading - so if you want to change the animation when it's loaded then do something on setTimeout(0) and add a setTimeout(500) or something to actually stop the animation. edit: but actually adding something that effectively elongates the load time does feel like a bit of a step backwards |
|
Thanks! Now that I think of it, is there documentation on this somewhere explaining what the |
|
yes - but as with all the Espruino functions it's defined in the C source code as comments: https://github.com/espruino/Espruino/blob/master/src/jswrap_timer.c#L215-L270 When a new release (2v29) is made it'll update in the main reference pages, but until then you can build your own reference file if needed, or just look at the code comments. |
Added a black and white wipe animation that uses the bg color to slide across the screen for a wipe effect