I have a macro that display the input box and I would like to have a drop down list with some images that the player can select from. Basically, they're choosing which image to represent their character.
Is this possible? I have all the images on a map, as seperate tokens. Would this be better off in a table? Haven't done this before in Maptool and not sure where to begin, even though I'm pretty sure I've seen it in some screenshots.
Thanks!
Input drop down with images?
Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice
- Full Bleed
- Demigod
- Posts: 4736
- Joined: Sun Feb 25, 2007 11:53 am
- Location: FL
Re: Input drop down with images?
Something like this:xavram wrote:I have a macro that display the input box and I would like to have a drop down list with some images that the player can select from. Basically, they're choosing which image to represent their character.
Is this possible? I have all the images on a map, as seperate tokens. Would this be better off in a table? Haven't done this before in Maptool and not sure where to begin, even though I'm pretty sure I've seen it in some screenshots.
Thanks!
Code: Select all
[h: charImageList = getImage("Token Name")]
[h:status=input(
"charImage|"+charImageList+"|Select Target|LIST|SELECT=0 ICON=TRUE ICONSIZE=30"
)]
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."
Re: Input drop down with images?
Is there any way to make the drop down itself bigger? The images I have are 150x75, native size, so they get compressed quite a bit on the input form, to the point that its actually hard to distinguish one from the other.
- Full Bleed
- Demigod
- Posts: 4736
- Joined: Sun Feb 25, 2007 11:53 am
- Location: FL
Re: Input drop down with images?
I assume that's what the ICONSIZE subparameter is for. My example was set to 30 because I basically pulled the base code from the example on the input wiki:xavram wrote:Is there any way to make the drop down itself bigger? The images I have are 150x75, native size, so they get compressed quite a bit on the input form, to the point that its actually hard to distinguish one from the other.
Wiki: input()
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."
Re: Input drop down with images?
Oh sweet, I just didn't see that in your sample! Excellent, that did the trick!
Re: Input drop down with images?
So I used this and it works...
However, I've got like 20 images in this table, which causes the dropdown list to be so big that it goes off the top and bottom of the screen, so you don't see all the options.
Is there any way to only show, say, half a dozen of the options at any given time? Most drop down controls in other languages have a "show max items" kind of setting to limit this but I don't see an option like this in the "Input" document for maptool.
Code: Select all
[h : x = 0]
[h : imageList = ""]
[h, while(x<20), code : {
[h : x = x + 1]
[h : imageList = listAppend(imageList, tableImage("Small", x))]
}]
[h:status=input(
"charImage|"+imageList+"|Select Target|LIST|SELECT=0 ICON=TRUE ICONSIZE=75|VALUE=STRING|SPAN=TRUE"
)]
[r : tableImage("Small", charimage)]
[h : setTokenImage(tableImage("Small", charimage+1))]
Is there any way to only show, say, half a dozen of the options at any given time? Most drop down controls in other languages have a "show max items" kind of setting to limit this but I don't see an option like this in the "Input" document for maptool.
- Full Bleed
- Demigod
- Posts: 4736
- Joined: Sun Feb 25, 2007 11:53 am
- Location: FL
Re: Input drop down with images?
And do what with the other options? You mean be able to sort of page through options like 6 at a time? I don't think there is a way to do that...xavram wrote: However, I've got like 20 images in this table, which causes the dropdown list to be so big that it goes off the top and bottom of the screen, so you don't see all the options.
Is there any way to only show, say, half a dozen of the options at any given time?
You could count the number of items in the list, and if it's larger than 6, add the extras to successive lists and dynamically create inputs based on the number of lists that you have.Most drop down controls in other languages have a "show max items" kind of setting to limit this but I don't see an option like this in the "Input" document for maptool.
That would, however, make multiple drop-down selections, so you'd have to create some kind of mechanic where the default was something like "No Selection" and then check that only one input is used to select something before going through with the operation.
That's pretty clunky though and will likely be more work than it's worth. If your list is going to be that big, it would be better to just use a text list or make the images display smaller.
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."