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

Support for Paths #35

Closed
zoomclub opened this issue May 14, 2013 · 1 comment
Closed

Support for Paths #35

zoomclub opened this issue May 14, 2013 · 1 comment

Comments

@zoomclub
Copy link

Sketch looks like an ideal fast Canvas / WebGL solution but I'm just wondering how it might be possible to use SVG paths within Sketch?

What I mean by path is just a string as defined by SVG. My app uses SVG data paths to define its symbols. The symbol paths are then listed in a JSON file and deserialized into a JavaScript cache object. I would take care of this bit of code. This minimal pre-canvas usage of SVG is the only aspect of SVG my app is concerned with.

From here on the focus is on the canvas and I'm not sure if there is some facility in Sketch to take such a cached path and render it to the view? Here is how a path could be used:

path = new Path('M 100,100 h 50 v 50 h 50');

As another option the JSON file of symbol paths could also be converted into a structure that Sketch uses? As long as there is some way to then clone that structure and raster it to screen it would work. Also not sure if Sketch maintains any type of scenegraph of objects, which might make hit detection easier?

@soulwire
Copy link
Owner

I think this is out of scope for what Sketch is trying to do. Think of Sketch as a useful boilerplate for helping create what you described, but providing no concrete implementation - it takes the pain out of mouse/touch events and running and update loop, handling resizes and so on - your path example is quite specific though and would bloat the library unnecessarily.

It sounds like paper.js might be useful to you and certainly isn't incompatible with Sketch.

Also, the next release will allow for plugins so features like this could potentially be distributed as optional extras.

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