I'd like to modify values passed in to my Layer class extension. So if I pass in width, I'd like to have a method that multiplies that by a factor that I also pass in.
The idea behind this is that I want to pass @1x values but for Framer to draw them @3x or @2x depending on what device I'm previewing in.
Nice! I wonder if this is something you could also write as a mixin? Layer is a great example of a class that I'd like to add a little functionality, but would prefer not having to actually extend it. Just a thought. Still trying to wrap my head around OOP in Coffee Script and best practices.
Isaac that's pretty much the way to do it. I don't think there is a way to enhance or monkey patch it.
At least I haven't found a clean way to do the @define get: set: on an existing class. I've looked a few times for ways to go about this too. Let me know if you find anything.
Pete Schaffner - Did you ever find a way to do this?
Isaac: check out my Material module. It exposes both a new class and adds the ability to mixin "Material props" to Layer (or whatever): https://github.com/peteschaffner/framer-material/blob/master/app.coffee#L416
Jordan: sure did! Check out this post: https://m.facebook.com/groups/385961098197634?view=permalink&id=706052822855125
Awesome Pete... Thanks for sharing.
thanks everyone for the input. I don't think I achieved everything as generically as I had hoped, but for my specific case I'm doing this http://share.framerjs.com/0a1q21466bik/