Page 1 of 1

How can i add floating text over image?

Posted: Tue Sep 20, 2011 7:16 am
by oblisgr
Hello,
I make some character sheet for my tokens and I m trying to make some inventory with icons.
I wander if there a way to make the name of the item to appear as floating text over my image when i move the cursor over it or when i click on it.

Anyone know if it can be done?
Any example will be valuable.
Thanks

Re: How can i add floating text over image?

Posted: Tue Sep 20, 2011 7:51 am
by aliasmask
You can set an image as a background, but you can't control the size (afaik). There is kind of a hack way to do it though. Impersonate a token and type that in to chat. It does look a bit different in a form (aligned text at bottom). You can try a play with the rowspan to move the text up higher and use valign=top for text line.

Code: Select all

<table><tr><td></td><td rowspan=2><img src ="[r: getTokenImage(80)]"></td></tr><tr><td colspan=2 nowrap>Text Test Text</td></tr></table> 

Re: How can i add floating text over image?

Posted: Wed Sep 21, 2011 7:19 am
by oblisgr
Well thank for the idea but this is not what i wanted to make.
Thanks for answer anyway! ;)

Re: How can i add floating text over image?

Posted: Wed Sep 21, 2011 8:21 am
by lmarkus001
Were you looking for hover tip like this?

Code: Select all

<image src="[R: getTokenImage()]" alt="HOVER TEXT" /> 
The image tag has an alt property that you can supply text too that will hover over the image.

Re: How can i add floating text over image?

Posted: Wed Sep 21, 2011 8:45 am
by aliasmask
lmarkus001 wrote:Were you looking for hover tip like this?

Code: Select all

<image src="[R: getTokenImage()]" alt="HOVER TEXT" /> 
The image tag has an alt property that you can supply text too that will hover over the image.
hehe, duh. I was overthinking it. Using a span tag works too, <span title="hover text">whatever...</span>.

Re: How can i add floating text over image?

Posted: Wed Sep 21, 2011 12:22 pm
by oblisgr
<td width=180 border="3" rowspan=8 Align=center><span title="hover text"><img src='[r:Portrait]' Height="135" Width="165"></img></span></td>

I made this but is not working neither "alt"
I made that in a dialog maybe that is the problem

Re: How can i add floating text over image?

Posted: Wed Sep 21, 2011 2:37 pm
by lmarkus001
Hummm... should work... I just did one in a frame without issue... keep tweaking and see if you can figure it out...

Re: How can i add floating text over image?

Posted: Wed Sep 21, 2011 2:55 pm
by CoveredInFish
You mean a dialog you created using [frame:] or [dialog:] OR Wiki: input()? The latter doesnt work IIRC. I

Re: How can i add floating text over image?

Posted: Wed Sep 21, 2011 6:47 pm
by oblisgr
dialog

Code: Select all

[dialog("Report", "width=520, height=500, noframe=1, bgcolor="black""): {
<html>
<head>
<title>Mob Report</title>
</head>
<body align=center width=530 height=500 bgcolor="black">

<table border="0" bgcolor="black">
<tr>
</tr>
<tr>
<td></td>
<td width=65 border="1" span style="color:white"><b>Name:</td>
<td width=130 border="1" bgcolor="black" span style="color:white" align=top colspan=3>[r: Name]</td>
<td width=65 border="0"></td>
<td width=10 border="0"></td>
<td width=180 border="3" rowspan=8 Align=center><span title="hover text"><img src='[r:Portrait]' Height="135" Width="165"></img></span></td>
</tr>
<tr>
<td></td>
<td width=65 border="1" span style="color:white"><b>Owner:</td>
<td width=65 border="1" bgcolor="black" span style="color:white">[r: Owner]</td>
</tr>
<tr>
...
...
...
...

Re: How can i add floating text over image?

Posted: Wed Sep 21, 2011 7:33 pm
by aliasmask
I used this code to test, which works.

Code: Select all

[H: Portrait = getTokenImage()]
[H: Name = getName()]
[H: Owner = getPlayerName()]
[dialog("Report", "width=520; height=500; noframe=1;"): {
<html>
<head>
<title>Mob Report</title>
</head>
<body align="center" width="530" height="500" bgcolor="black">

<table border=1 style="background-color:black">
   <tr></tr>
   <tr>
      <td></td>
      <td width="65" border="1" style="color:white;border-style:solid;border-width:1"><b>Name:</b></td>
      <td width="130" border="1" bgcolor="black" style="color:white" align="top" colspan=3>[r: Name]</td>
      <td width="65" border="0"></td>
      <td width="10" border="0"></td>
      <td width="180" border=3 rowspan="8" Align="center"><span title="hover text"><img src="[r:Portrait]" Height="135" Width="165"></img></span></td>
   </tr>
   <tr>
      <td></td>
      <td width="65" border="1" style="color:white"><b>Owner:</b></td>
      <td width="65" border="1" bgcolor="black" style="color:white">[r: Owner]</td>
   </tr>
</table>
</body>
</html>
}]
 

Re: How can i add floating text over image?

Posted: Wed Sep 21, 2011 7:50 pm
by oblisgr
aliasmask wrote:I used this code to test, which works.

Code: Select all

[H: Portrait = getTokenImage()]
[H: Name = getName()]
[H: Owner = getPlayerName()]
[dialog("Report", "width=520; height=500; noframe=1;"): {
<html>
<head>
<title>Mob Report</title>
</head>
<body align="center" width="530" height="500" bgcolor="black">

<table border=1 style="background-color:black">
   <tr></tr>
   <tr>
      <td></td>
      <td width="65" border="1" style="color:white;border-style:solid;border-width:1"><b>Name:</b></td>
      <td width="130" border="1" bgcolor="black" style="color:white" align="top" colspan=3>[r: Name]</td>
      <td width="65" border="0"></td>
      <td width="10" border="0"></td>
      <td width="180" border=3 rowspan="8" Align="center"><span title="hover text"><img src="[r:Portrait]" Height="135" Width="165"></img></span></td>
   </tr>
   <tr>
      <td></td>
      <td width="65" border="1" style="color:white"><b>Owner:</b></td>
      <td width="65" border="1" bgcolor="black" style="color:white">[r: Owner]</td>
   </tr>
</table>
</body>
</html>
}]
 
I copied - pasted on a new makro and it doesnt work.
Maybe somewhere there is a prob... dunno :(

Re: How can i add floating text over image?

Posted: Wed Sep 21, 2011 7:53 pm
by aliasmask
I impersonated a token, then put the code in the chat window.

Make sure for your macro, that "apply to selected" was checked.

Re: How can i add floating text over image?

Posted: Wed Sep 21, 2011 8:01 pm
by oblisgr
Ye i checked impersonate and apply to selected but still is not wotking.

I m trying these 2 lines at same makro

Code: Select all

<span title="Mutanus"><img src='[r:Portrait]' Height="135" Width="165"></img></span>
<br>
<img src='[r:Portrait]' alt="Mutanus" Height="135" Width="165"></img>
span is not working
alt is working

ofc i prefer span because is more agile while alt is lagginh a bit.

Actually i tried on text and it works there but it doesnt on picture.
dunno...

Maybe i have bad program version?
I use 1.3.b85

Re: How can i add floating text over image?

Posted: Wed Sep 21, 2011 8:47 pm
by aliasmask
You're right, span doesn't work for the image alt text. span does work for actual text and is only activate by hovering over the text.. so if there is white space or an image, it doesn't show.

Re: How can i add floating text over image?

Posted: Sun Sep 07, 2014 12:41 pm
by Nertht
I´v got same problem with alt. Main problem is in ROWSPAN. Alt is showing just in first row. In space of second row alt text dissapear...