Image buttons for Macros, performance hit?

Discuss macro implementations, ask for macro help (to share your creations, see User Creations, probably either Campaign Frameworks or Drop-in Resources).

Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice

Post Reply
User avatar
JamzTheMan
Great Wyrm
Posts: 1872
Joined: Mon May 10, 2010 12:59 pm
Location: Chicagoland
Contact:

Image buttons for Macros, performance hit?

Post by JamzTheMan »

So I whipped out some image buttons for some campaign macro's to toggle lights (we use them heavily so they deserve their own buttons vs using a pop-up menu!)

I liked the thought of condensing 12 macro's into the space of 6-8 and we had handy artwork to match the "states" but...

The question is, is there a performance hit using images for buttons? I noticed most frameworks don't seem to use them much? And I noticed saving any macro now takes a few extra seconds to close. I'm guessing MT is re-downloading every image from the web onClose?

Should I refrain from changing another 20+ macro's to images? Thoughts on Images vs Text for buttons?

FYI: I have the images stored on my web server, so http:// sources. I didn't see a way to use table or token images?
lights.png
lights.png (23.89 KiB) Viewed 588 times
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Image buttons for Macros, performance hit?

Post by wolph42 »

I use image buttons in the bag of tricks and have no negative experience with those. However I use them in a form and I understand that you use them for actual macro buttons. Little experience with that. IRC rumble used to do that, but he aint around anymore

User avatar
aliasmask
RPTools Team
Posts: 9029
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: Image buttons for Macros, performance hit?

Post by aliasmask »

You can use images from a table, but in order to put them on a campaign macro you'll need to get the asset id manually first and then use it in place of html image url.

For example, to get assetId manually type in to chat [tableImage("lightImages",1)] and copy assetId in output. Then set button to <img src="assetId://..." />. You may have to play with some formatting. I don't recall if you need to surround it with <html> tags, but I don't think so.

User avatar
JamzTheMan
Great Wyrm
Posts: 1872
Joined: Mon May 10, 2010 12:59 pm
Location: Chicagoland
Contact:

Re: Image buttons for Macros, performance hit?

Post by JamzTheMan »

Thanks for the tip, may try table image to see if it helps. Or hack the cache mechanic.

It does seem to refresh the images on every save of any macro so that's annoying (~4 second delay) but otherwise I'm not seeing any other performance hit.
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork

User avatar
aliasmask
RPTools Team
Posts: 9029
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: Image buttons for Macros, performance hit?

Post by aliasmask »

It would probably speed things up if you didn't put the images in a table but saved them as tokens. Back when I was playing with token animations I noticed the lag when getting image data from a table so I would preload those images when starting campaign which was a janky way of doing it. Having them saved as tokens is much faster.

Post Reply

Return to “Macros”