Icon images, hilites and inks
Richmond Mathewson
richmondmathewson at gmail.com
Wed Oct 14 14:27:01 EDT 2009
David Bovill wrote:
> I've got some grey images that are used for icons - and I want to hilite
> them with a simple coloured overlay of equivalent when the mouse rolls over
> the button. I'm wandering if it is possible to use some combination of inks
> and button colours to achieve this effect? The only way I can see how to do
> it at the moment is either to create a coloured icon image and swap them, or
> create an overlay button in front of the icon button which at least does not
> require creating another set of images but seems ugly.
>
> Any thoughts?
> _______________________________________________
>
Aaah; just the sort of thing I like at the end of a working day to wind down
with - Thanks David . . . :)
---------------------------------------------------------------------------------------------------
Well, I've just made myself a suitably repulsive png file with an amorphous
grey blob in the middle of some transparency and imported it into a stack.
Set up a button and set the icon to my png.
1. Tried the COLOR OVERLAY combined with an INK (which, for some funny
reason,
is now termed BLEND in the Preferences Palette).
This does not work because the INK / BLEND is applied to the whole
button rather
than just the ICON . . . b*gg*r.
2. Tried mucking about with the INK / BLEND of the png:
on mouseEnter
set the ink of img "sbone.png" to blendDstIn
set the icon of me to 1004
end mouseEnter
on mouseLeave
set the ink of img "sbone.png" to blendXor
set the icon of me to 1004
end mouseLeave
where "sbone.png" is the icon image.
This works, as far as ot goes, insofar as it applies an INK,
but not a coloured overlay.
3. Mucked around with the COLOR OVERLAY of the button:
on mouseEnter
set the ink of img "sbone.png" to blendDstIn
set the icon of me to 1004
lock screen
set the coloroverlay["color"] of me to green
set the coloroverlay["opacity"] of me to "100"
unlock screen
end mouseEnter
on mouseLeave
set the ink of img "sbone.png" to blendXor
set the icon of me to 1004
set the outerGlow of me to empty
set the colorOverlay of me to empty
end mouseLeave
This is really quite 'sexy'; the only problem being
that if you have a standard metal-effect button
everything disappears except the grey shape
(which turns green). Even if you set the
border so it is NOT 3d it is still hidden.
Unfortunately my Website has been playing dead for
48 hours so will not be able to pop my experimental
stack there just yet.
sincerely, Richmond Mathewson.
More information about the use-livecode
mailing list