Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I want draw segmentImage without margin between each segements. #125

Open
JKwang00 opened this issue Jun 20, 2023 · 2 comments
Open

I want draw segmentImage without margin between each segements. #125

JKwang00 opened this issue Jun 20, 2023 · 2 comments

Comments

@JKwang00
Copy link

hello :)
I love this. but i have some issue. i need help.
i want image segments without margin because i already use different background color each segment images.
so i no need margin.
but i can't find any property.

i use lineWidth but nothing change.

have a nice day!
let theWheel = new Winwheel({ 'canvasId': 'rolutte', 'numSegments' : 7, // Specify number of segments. 'lineWidth' : 0, 'strokeStyle': 'red', 'outerRadius' : 400, // Set outer radius so wheel fits inside the background. 'drawText' : true, // Code drawn text can be used with segment images. 'segmentStrokeWidth' : 0, 'textFontSize' : 0, 'textOrientation' : 'curved', 'textAlignment' : 'inner', 'textMargin' : 90, 'textFontFamily' : 'monospace', 'textStrokeStyle' : 'black', 'textLineWidth' : 3, 'textFillStyle' : 'white', 'drawMode' : 'segmentImage', // Must be segmentImage to draw wheel using one image per segemnt. 'segments' : // Define segments including image and text. [ {'lineWidth':0,'image' : '/img/roulette/chunk1.png', 'text' : 'Jane'}, {'lineWidth':0,'image' : '/img/roulette/chunk2.png', 'text' : 'Tom'}, {'lineWidth':0,'image' : '/img/roulette/chunk3.png', 'text' : 'Mary'}, {'lineWidth':0,'image' : '/img/roulette/chunk4.png', 'text' : 'Alex'}, {'lineWidth':0,'image' : '/img/roulette/chunk5.png', 'text' : 'Sarah'}, {'lineWidth':0,'image' : '/img/roulette/chunk6.png', 'text' : 'Bruce'}, {'lineWidth':0,'image' : '/img/roulette/chunk7.png', 'text' : 'steeve'} ], 'animation' : // Specify the animation to use. { 'type' : 'spinToStop', 'duration' : 5, // Duration in seconds. 'spins' : 8, // Number of complete spins. 'callbackFinished' : alertPrize } });

@cantdocpp
Copy link

If you're using an image wheel. i suggest that stop using image per segment like that. Just use the whole wheel with all its segments, I've tried that and got no problem with it.

You just have to make sure that the combined segment image start between the start and the end.

If you're still not understand, you can see the docs: http://dougtesting.net/winwheel/docs/tut9_creating_with_an_image
even the author is using the whole image segment as the background and not using it as background image per segment

@JKwang00
Copy link
Author

JKwang00 commented Jun 21, 2023

@cantdocpp
Thank you for reply.
i just want to know how can i remove margin each image segments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants