Resize shortcut or hover effect with labels? Thread last updated on 2004-01-06 22:50:42

Posted by member 2112 on 2004-01-04 17:46:28

I need a module that allows you to create a button that can be resized using a bang and use an image for both a normal and hover state.

Label can be resized but does not provide a way to use a hover image and shortcuts can use a hover image but cannot be resized.

Does anyone have any tricks to be able to do this? I'm creating a fairly minimal theme so I want to avoid adopting modules I don't need.

Posted by member 1 on 2004-01-04 18:26:25 link

shortcut with a hotspot

Posted by member 2112 on 2004-01-04 19:46:52 link

I don't understand. I don't think I explained myself properly. I have a button in my theme that I need to be able to resize using a bang and supports hover effects. Neither Shortcut or Label have both these functions (AFAIK).

Posted by member 36955 on 2004-01-04 20:04:30 link

you could use label and just make 2 of them, switching between them with onmouseenter and onmouseleave to simulate hover

Posted by member 2112 on 2004-01-04 20:10:41 link

So you mean to create 2 labels then use hide and show to toggle between them? I don't think you can change the image for a label with a bang, can you?

Posted by member 36955 on 2004-01-05 00:41:01 link

yeah, that or just create the hover label on top of the non hover label... its probably easier that way

Posted by member 2112 on 2004-01-05 01:11:09 link

Using show/hide works pretty nicely. The only catch was that on OnMouseLeftClick I wanted the label hide completely, but when I moved my mouse OnMouseLeave took effect and the label appeared again. So I have to destroy the label instead of hiding it with the OnMouseLeftClick and use hide/show for the hove effect.

Posted by member 99 on 2004-01-05 01:17:45 link

*skinbox f 10 10 80 80 #t
fBitmap $bleh$normal.png
fOnMouseOver !execute [!SkinBoxBitmap f $bleh$hover.png][!SkinBoxMove f 0 0 100 100]
fOnMouseOut !execute [!SkinBoxBitmap f $bleh$normal.png][!SkinBoxMove f 10 10 80 80]

I think...

Posted by member 37809 on 2004-01-05 07:18:46 link

If it's just a plain shortcut I think you can have the normal image have a magic pink border for the area occupied by the hover image.

Posted by member 2112 on 2004-01-05 14:55:36 link

I really didn't explain this properly, did I :) The button width could be any width between 10 and 100 pixels or even more. And it will resize dynamically without user input. The hover image will be the same size as the normal image. Thanks for your tip anyway. I have implemented a solution now which I'm happy with, but still interested to hear of different solutions.

Posted by member 32550 on 2004-01-06 11:11:07 link

The new xlabel-2.5.5 supports hover and pressed images with TrueTransparency (resizable).
Release on 07.01.04 search on http://www.lsd-trip.de for it
Andymon

Posted by member 99 on 2004-01-06 22:50:42 link

fwiw, that wasn't intended to be a complete solution, just a short example to show what's possible. :) (and I was really slow in actually posting that...)