-
-
Notifications
You must be signed in to change notification settings - Fork 616
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
Integration with PIXIjs #163
Comments
I have not used pixijs, so cannot say. |
I'm thinking in integrating it in PIXI Custom components, using graphics(that in underlying implementation uses a canvas context). Somethink like that, but using rough. Then we will have acess to PIXI Library. It will awesome. const Rectangle = PixiComponent('Rectangle', {
}) |
you can try this roughGenerator import rough from 'roughjs/bundled/rough.esm';
import RoughType from 'roughjs';
declare type RoughGenerator = ReturnType<typeof RoughType.generator>;
const generator = rough.generator(undefined);
const roughGeneratorInstance = generator as RoughGenerator;
export const roughGenerator = roughGeneratorInstance; const rectangle = roughGenerator.rectangle(0, 0, 100, 100);
rectangle.sets.forEach(step => {
if (step.type === 'path') {
step.ops.forEach(({op, data}) => {
const [cp1x, cp1y, cp2x, cp2y, x, y] = data;
switch (op) {
case "bcurveTo":
buttonDraw.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y)
break;
case "lineTo":
buttonDraw.lineTo(cp1x, cp1y)
break;
case "move":
buttonDraw.moveTo(cp1x, cp1y)
break;
default:
break;
}
})
}
}); |
Def interested in webgl version |
Hi guys,
Did you see possibility on integration with PIXIJS Custom Sprites?
Thanks!
The text was updated successfully, but these errors were encountered: