Created
November 13, 2025 17:34
-
-
Save luizbills/d7849461df05882610ea0c6d73d056e6 to your computer and use it in GitHub Desktop.
Rect with animated dashed border in Litecanvas
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| litecanvas({ | |
| width: 320, | |
| autoscale: false | |
| }) | |
| let offset = 0 | |
| let pos = vec(10, 10) | |
| function tapped(x, y) { | |
| vecSet(pos, x, y) | |
| } | |
| function update(dt) { | |
| offset += 24 * dt; | |
| if (offset > 8) offset = 0 | |
| } | |
| function draw() { | |
| cls(0) | |
| linedash([4, 4], -offset) | |
| linewidth(2) | |
| rect(pos.x, pos.y, 32, 32, 3) | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Live Demo