streetmix / streetmix

Streetmix makes it easy for people to design public spaces together.
https://streetmix.net
Other
673 stars 190 forks source link

automatically generate sprite sheets from individual image files #429

Closed drewda closed 8 years ago

drewda commented 10 years ago

Rather than pre-baked sprite sheets (https://github.com/codeforamerica/streetmix/blob/master/public/images/tiles-1.png , https://github.com/codeforamerica/streetmix/blob/master/public/images/tiles-2.png , and https://github.com/codeforamerica/streetmix/blob/master/public/images/tiles-3.png ), having the sprite sheets auto-generated from individual PNGs would allow for more flexibility and future expansion.

@louh or @mwichary: Do either of you have the segments as individual images? If so, would you mind sharing those files with me?

Note to self, I'm used to using Compass to do this in the Ruby world. Perhaps worth trying https://github.com/selaux/node-sprite-generator here.

louh commented 10 years ago

We do have all the images individually in separate illustrator files right now. They're actually manually concatenated into a single AI file then exported as PNG. But we can easily generate individual PNGs from each illustrator file and let a script handle the workflow of concatenation and finding coordinates (again, something that's manually done by @mwichary).

The files are on Dropbox - send your Dropbox account over e-mail and I'll share the folder with you. I also have a bunch of time this weekend (hooray Memorial Day!) to make PNGs for you to mess with.

I browsed the node-sprite-generator quickly and it looks pretty promising, but I think either this way or Compass has an additional wrinkle because they assume the output for sprite definition is CSS. In Streetmix the sprite definitions are Canvas-based, so the output should be JSON or similar.

Do you think the script should generate tilesheets whenever the server starts, or is it essentially a standalone one (to generate all the tilesheets + data prior to server start, for example, or it can be basically executed on-demand, e.g. if someone updates an asset it can update the static files without having to necessarily restart a server)

drewda commented 10 years ago

Hey @louh, I'm getting back to this task now... Would you mind granting me commit privileges here? I think it's going to take some back-and-forth between both of us to figure this out, so it's probably best if we work in a feature branch in the same repo.

louh commented 10 years ago

Yeah, it would certainly be more conducive this way, and I thought about adding you directly last time but CfA repositories permissions are based on teams, and it looked like if I added you to the team it would add you to the CfA organization as well, and I didn't want to step on anyone's toes. Pinging @migurski for permission / suggestions?

I did create a https://github.com/streetmix/ organization a few months ago, to squat on it and in case it ever makes sense to manage Streetmix-related repositories and permissions outside of the CfA org.

drewda commented 10 years ago

Makes sense. We'll see what Mike recommends... On Jul 1, 2014 6:59 PM, "Lou Huang" notifications@github.com wrote:

Yeah, it would certainly be more conducive this way, and I thought about adding you directly last time but CfA repositories permissions are based on teams, and it looked like if I added you to the team it would add you to the CfA organization as well, and I didn't want to step on anyone's toes. Pinging @migurski https://github.com/migurski for permission / suggestions?

I did create a https://github.com/streetmix/ organization a few months ago, to squat on it and in case it ever makes sense to manage Streetmix-related repositories and permissions outside of the CfA org.

— Reply to this email directly or view it on GitHub https://github.com/codeforamerica/streetmix/issues/429#issuecomment-47729824 .

migurski commented 10 years ago

You're on the team, Drew!

louh commented 10 years ago

yay!

drewda commented 10 years ago

Thanks, Mike!

louh commented 8 years ago

Deprecated in favor of SVG symbols; proof of concept here: https://github.com/codeforamerica/streetmix/tree/images