Apply an SVG Widget as a single object in a stack to multiple buttons as icon?
Sannyasin Brahmanathaswami
brahma at hindu.org
Sat Jun 18 22:48:46 EDT 2016
With images we can import a raster "object" and then set the icon of a button to that image.
Wouldn't it be nice to be able to do the same with a SVG file? Theoretically then the different buttons calling that same (0ne and one only in the stack) SVG image as their icon could have varying sizes, but the image would still be perfect (since icon is rendering a vector object)
What is the use case? If our designers do cool things in illustrator. (hopefully one day we can support multiple colors and gradients in LC SVG widgets) we would just like to save them once and call them into various contexts. Scenarios would include background on text button links, small icons on maps that would appear perfectly at any zoom level etc. Even better: have a label that can sit on top.
see:
http://wiki.hindu.org/screenshots/vector-btn-bkgnds.jpg
the ragged "patches" behind the text/button links are vector… previously I was forced to save as PNG.. set the icon to a pattern, use the png as the pattern set icon gravity … careful manipulation of margins… But, advantage was: it was still a single object in the stack and the PNG could be applied to multiple buttons.
now I'm trying to see how I can get these as single SVG object(s)without having to have
a) SVG widget underneath
b) text button on top
So, we all know this -- except for lurking newbies, so FWIW we will "declare" the obvious:
currently the icon of a button set to an image requires that image to be the precisely sized to meet the button's display size/rendering requirements. I have in some scenarios, dynamically resized images that are used for button icons on different cards, so that they appear correctly. Goal was, obviously not to have multiple instances of the same image across multiple cards.
One might have a case where there were large buttons on a card… then the image for the icons may need to be set at e.g. 128 X 128.. then if you displayed them on a grid on another card you might down size them dynamically to 32 X 32.
Problem is of course there is always a break down of the image quality, even if set to "best" with SVG that should go away.
Is anyone doing this? I visualize a scenario where one dynamically sets the SVG path to a string that might be, for example, stored as a custom property (instead of on an "image resources" card)
Would it be worth it to make this a feature request, so that this icon assignment would be indifferent to the image format .png, svgwidget, jpg? Then you could still work with "the button name" programmatically.
BR
More information about the use-livecode
mailing list