doodle/dev-assets/doodads/buttons/button.js

18 lines
276 B
JavaScript
Raw Permalink Normal View History

function main() {
console.log("%s initialized!", Self.Doodad.Title);
var timer = 0;
Events.OnCollide( function() {
if (timer > 0) {
clearTimeout(timer);
}
Self.ShowLayer(1);
timer = setTimeout(function() {
Self.ShowLayer(0);
timer = 0;
}, 200);
})
}