jdan / isomer

Simple isometric graphics library for HTML5 canvas
http://jdan.github.io/isomer
MIT License
2.87k stars 139 forks source link

Diamond as native shape #64

Open dnkmdg opened 9 years ago

dnkmdg commented 9 years ago

I'd love to have the diamond-shape as a native shape like, preferably with the ability to set sides (much like cylinder objects).

Oh, and love your work <3

jdan commented 9 years ago

I usually encourage folks to just go forth and make those shapes, instead of adding them to the standard library. For instance, I can imagine something like

var diamond = require("isomer-diamond");
iso.add(diamond(8));

This should be doable now, but I hope to make it easier - by making the Shape API better. Thoughts?

whoeverest commented 9 years ago

I agree with @jdan it's better to keep special shapes separate. Maybe we should create an isomer-shapes repository, so we can keep track of them there?

jbovenschen commented 9 years ago

I agree to with @jdan. But i think it is better to just create separate builds for isomer. So we can keep the utils / shapes in the some repository.

In my own fork i added a method to add custom Shapes / Paths to the Shape and Path constructors.

jdan commented 9 years ago

@jbovenschen happy to review if you ever want to merge it :) of course you don't need my approval

derhuerst commented 9 years ago

I had the same problem with velo, my minimalistic 2D canvas library. I wanted to keep the footprint very small but introduce some flexibility for developers to use third-party "modules".

I ended up with a build system that reads the list of modules do be bundled from package.json. And I am quite happy with it. Read more about how to customize velo with your own modules.

Because modules in velo are just directories containing JavaScript files, developers can use Git submodules to add their third-party stuff and still keep the main repo clean.

derhuerst commented 9 years ago

Things rather unrelated to the core like #8 could be done like this.

In fact, in velo, I added a few things that are in the main repo, but not in the default build.