Skip to content

Understanding customizable pieces outlines feature? #55

Answered by flbulgarelli
johnneerdael asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @johnneerdael!

headbreaker supports customizable outlines in the sense that you can override completely the pieces' rendering strategy. You just have to pass your own outline object, as it is shown in the Rounded demo:

const rounded = new headbreaker.Canvas('rounded-canvas', {
   width: 500, height: 300,
   outline: new headbreaker.outline.Rounded() 
});

However, you are right in that nowhere is documented how do define an online object. It is quite straightforward, though: it has to understand two messages: isBezier and draw- which takes the piece to draw, its size and border width. The first method just tells whether to use a normal o bezier line, and the latter, which lines to draw.

I…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by flbulgarelli
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants