How do I place an image for a macro button's tooltip

Thoughts, Help, Feature Requests, Bug Reports, Developing code for...

Moderators: dorpond, trevor, Azhrei

Forum rules
PLEASE don't post images of your entire desktop, attach entire campaign files when only a single file is needed, or generally act in some other anti-social behavior. :)
Post Reply
nirkedar
Cave Troll
Posts: 52
Joined: Tue Sep 21, 2010 3:13 pm

How do I place an image for a macro button's tooltip

Post by nirkedar »

I'd like to create a decent tooltip for my macro buttons using HTML. Is it possible to have an image from a table inside this tooltip.

Here's the HTML code:
[spoiler=]

Code: Select all

. <html>
. . <div width=400>
. . . <table width='100%'>
. . . . <tr>
. . . . . <td style='padding:0px 0px; 'align='left' width='15%'>
. . . . . . <span style='font:bold 11pt Tahoma; color:2C3539; ' >Input:
. . . . . . </span>
. . . . . </td>
. . . . . <td style='padding:0px 0px; 'align='left' width='85%'>
. . . . . . <span style='font:italic 11pt Tahoma; color:2C3539; ' >FullText, ID
. . . . . . </span>
. . . . . </td>
. . . . </tr>
. . . . <tr>
. . . . . <td style='padding:0px 0px; 'align='left' width='15%'>
. . . . . . <span style='font:bold 11pt Tahoma; color:2C3539; ' >Output:
. . . . . . </span>
. . . . . </td>
. . . . . <td style='padding:0px 0px; 'align='left' width='85%'>
. . . . . . <span style='font:italic 11pt Tahoma; color:2C3539; ' >{Text, indexStart, indexEnd}
. . . . . . </span>
. . . . . </td>
. . . . </tr>
. . . </table>
. . . <table width='100%'>
. . . . <tr>
. . . . . <td align='Left'; width='100%'>
. . . . . . <img border=0 src='asset://c11af41f97b48b96f312352b86f77967-250'>
. . . . . . </img>
. . . . . </td>
. . . . </tr>
. . . . <tr>
. . . . . <td style='padding:0px 0px; 'align='left' width='100%'>
. . . . . . <span style='font:italic 11pt Tahoma; color:2C3539; ' >Finds the section within the script and returns an object with the text and start and end positions within the script.<br>Returns null if it could not be found.
. . . . . . </span>
. . . . . </td>
. . . . </tr>
. . . </table>
. . </div>
. </html>
[/spoiler]

In the Chat window it comes up as:
Chat.png
Chat.png (11.42 KiB) Viewed 903 times


However when I hover over the button I get this:
Tooltip.png
Tooltip.png (13.84 KiB) Viewed 903 times


Any tips?

User avatar
aliasmask
Deity
Posts: 8667
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: How do I place an image for a macro button's tooltip

Post by aliasmask »

try removing the -250 and put height=250 width=250.

nirkedar
Cave Troll
Posts: 52
Joined: Tue Sep 21, 2010 3:13 pm

Re: How do I place an image for a macro button's tooltip

Post by nirkedar »

Nope didn't work.
Is it even possible to put an image inside a tooltip?

User avatar
aliasmask
Deity
Posts: 8667
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: How do I place an image for a macro button's tooltip

Post by aliasmask »

In the macro button tooltip, yes. This worked for me:

Code: Select all

<html><img src="asset://4a308b74558a3a553af4dc8908f45204" height=50 width=50 /></html>

User avatar
Full Bleed
Demigod
Posts: 4558
Joined: Sun Feb 25, 2007 11:53 am
Location: MD
Contact:

Re: How do I place an image for a macro button's tooltip

Post by Full Bleed »

nirkedar wrote:Is it even possible to put an image inside a tooltip?

Pretty sure it is... but the syntax is tricky.

Check out this post: viewtopic.php?f=20&t=25999
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."

nirkedar
Cave Troll
Posts: 52
Joined: Tue Sep 21, 2010 3:13 pm

Re: How do I place an image for a macro button's tooltip

Post by nirkedar »

It works!!!!
Check it out.
Screen Shot 2016-06-16 at 18.03.16.png
Screen Shot 2016-06-16 at 18.03.16.png (17.89 KiB) Viewed 890 times


Boy oh boy - does this open up a can of opportunities for other tooltips. I'm so excited.
Thanks a 1000000.

nirkedar
Cave Troll
Posts: 52
Joined: Tue Sep 21, 2010 3:13 pm

Re: How do I place an image for a macro button's tooltip

Post by nirkedar »

Curious: is there a built in MT command that can retrieve the dimensions (pixel width & height) of my images that I have stored in tables?

User avatar
aliasmask
Deity
Posts: 8667
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: How do I place an image for a macro button's tooltip

Post by aliasmask »

There are some new functions, but this only works if on a map. With the new table functions you can drop a bunch of images on a map and run a macro to put the image and image data in to the table. [wfunc]getTokenWidth[/wfunc] [wfunc]getTokenHeight[/wfunc]

nirkedar
Cave Troll
Posts: 52
Joined: Tue Sep 21, 2010 3:13 pm

Re: How do I place an image for a macro button's tooltip

Post by nirkedar »

Is there a command that drops table images onto a map?

User avatar
wolph42
Deity
Posts: 9853
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: How do I place an image for a macro button's tooltip

Post by wolph42 »

nirkedar wrote:Is there a command that drops table images onto a map?

not directly but its possible:

make sure there is a token on the map, lets say someToken:

tmp = getImage(someToken)
setImage(getTableImg(bla),someToken)
copyToken(someToken)
setImage(tmp,someToken)

i probly got the actual function names wrong so be sure to check them out in the wiki, but that the gest of it. You MUST set the image BEFORE you copy it or it won't work (copytoken resets everything changed AFTER the copy)

nirkedar
Cave Troll
Posts: 52
Joined: Tue Sep 21, 2010 3:13 pm

Re: How do I place an image for a macro button's tooltip

Post by nirkedar »

Interesting. I'll give it a shot.
Thanks for all the (instant) feedback as usual guys. You're the bestest moderators ever.

Post Reply

Return to “MapTool”