verlet-js icon indicating copy to clipboard operation
verlet-js copied to clipboard

Custom bg and fg highlight

Open SebastianCrow opened this issue 10 years ago • 1 comments

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

SebastianCrow avatar Mar 04 '15 23:03 SebastianCrow

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

SebastianCrow avatar Mar 04 '15 23:03 SebastianCrow