How can i add floating text over image?

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
oblisgr
Giant
Posts: 132
Joined: Mon Aug 01, 2011 6:43 am
Location: Crete,Greece
Contact:

How can i add floating text over image?

Post 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
High Templar of Ur

User avatar
aliasmask
RPTools Team
Posts: 9031
Joined: Tue Nov 10, 2009 6:11 pm
Location: California

Re: How can i add floating text over image?

Post 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> 

oblisgr
Giant
Posts: 132
Joined: Mon Aug 01, 2011 6:43 am
Location: Crete,Greece
Contact:

Re: How can i add floating text over image?

Post by oblisgr »

Well thank for the idea but this is not what i wanted to make.
Thanks for answer anyway! ;)
High Templar of Ur

User avatar
lmarkus001
Great Wyrm
Posts: 1867
Joined: Sat Mar 29, 2008 12:30 am
Location: Layfayette Hill, PA

Re: How can i add floating text over image?

Post 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.

User avatar
aliasmask
RPTools Team
Posts: 9031
Joined: Tue Nov 10, 2009 6:11 pm
Location: California

Re: How can i add floating text over image?

Post 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>.

oblisgr
Giant
Posts: 132
Joined: Mon Aug 01, 2011 6:43 am
Location: Crete,Greece
Contact:

Re: How can i add floating text over image?

Post 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
High Templar of Ur

User avatar
lmarkus001
Great Wyrm
Posts: 1867
Joined: Sat Mar 29, 2008 12:30 am
Location: Layfayette Hill, PA

Re: How can i add floating text over image?

Post by lmarkus001 »

Hummm... should work... I just did one in a frame without issue... keep tweaking and see if you can figure it out...

User avatar
CoveredInFish
Demigod
Posts: 3104
Joined: Mon Jun 29, 2009 10:37 am
Location: Germany
Contact:

Re: How can i add floating text over image?

Post by CoveredInFish »

You mean a dialog you created using [frame:] or [dialog:] OR Wiki: input()? The latter doesnt work IIRC. I

oblisgr
Giant
Posts: 132
Joined: Mon Aug 01, 2011 6:43 am
Location: Crete,Greece
Contact:

Re: How can i add floating text over image?

Post 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>
...
...
...
...
High Templar of Ur

User avatar
aliasmask
RPTools Team
Posts: 9031
Joined: Tue Nov 10, 2009 6:11 pm
Location: California

Re: How can i add floating text over image?

Post 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>
}]
 

oblisgr
Giant
Posts: 132
Joined: Mon Aug 01, 2011 6:43 am
Location: Crete,Greece
Contact:

Re: How can i add floating text over image?

Post 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 :(
High Templar of Ur

User avatar
aliasmask
RPTools Team
Posts: 9031
Joined: Tue Nov 10, 2009 6:11 pm
Location: California

Re: How can i add floating text over image?

Post 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.
Attachments
Image1.jpg
Image1.jpg (20.25 KiB) Viewed 1189 times

oblisgr
Giant
Posts: 132
Joined: Mon Aug 01, 2011 6:43 am
Location: Crete,Greece
Contact:

Re: How can i add floating text over image?

Post 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
High Templar of Ur

User avatar
aliasmask
RPTools Team
Posts: 9031
Joined: Tue Nov 10, 2009 6:11 pm
Location: California

Re: How can i add floating text over image?

Post 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.

Nertht
Kobold
Posts: 23
Joined: Sun Jul 27, 2014 3:46 am

Re: How can i add floating text over image?

Post 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...

Post Reply

Return to “MapTool”