verlet-js
verlet-js copied to clipboard
Custom bg and fg highlight
Hi,
I've added a possibility to define background and foreground highlights.
It's also possible to drop highlight at all (by assigning empty function to drawFgHighlight).
Question is: why background highlight? For example, I've found it useful to render drop shadow under hovered entity.
Best Regards
P.S. Highlight is done by assigning appropriate render functions:
entity.drawBgHighlight = function(ctx) { /* draw in context */ };
// empty function => no highlight; undefined, null => no highlight
entity.drawFgHighlight = function(ctx) { /* draw in context */ };
// empty function => no highlight; undefined, null => default highlight