Skip to content

Instantly share code, notes, and snippets.

@luizbills
Created November 13, 2025 17:34
Show Gist options
  • Select an option

  • Save luizbills/d7849461df05882610ea0c6d73d056e6 to your computer and use it in GitHub Desktop.

Select an option

Save luizbills/d7849461df05882610ea0c6d73d056e6 to your computer and use it in GitHub Desktop.
Rect with animated dashed border in Litecanvas
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)
}
@luizbills
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment