Mask (insert) issue

Hey there! I have been updating my Vassal mod with new piece graphics. The piece on the left is my old piece, and the piece on the right is one of my new pieces. The view is of the pieces from the controlling player’s perspective while masked.

I’d like to get the little flag indicating the mask state to behave like the piece on the left. I haven’t changed any settings when updating, only the flag graphic, and yet the masking is not behaving as I would like.

Any suggestions hugely appreciated.

flag-insert

Are the pixel dimensions of the old and new image identical?

Yes, they are identical.

If you can post the work-in-progress module and the old version of the image to some form of cloud storage, I’ll take a look at it. Be sure to include a description of where in the Editor to find the piece in question.

I believe you when you say the dimensions haven’t changed, but I had to ask–on multiple occasions I’ve seen users say the same and upon investigation it turns out to not be the case. Often there’s no telling what software or procedure is being used for image operations and what level of understanding is on the other end!

Before I go through trying to make the mod downloadable, would you be able to tell me how this feature is supposed to work? Does the positioning of the small inset flag simply change from piece to piece depending on the size of the flag img and piece?

You can post a screenshot of your Mask trait config to confirm, but from that picture I’m guessing you have chosen Display style: Inset, which per the docs does:

Inset draws the mask image at reduced size over top of the regular image, inset into the upper left corner.

You can’t configure the amount of size reduction, so that’s the origin of my question about base image and mask image sizes.

Yes, I am using Display style: inset.

Regardless if my images are identical, is this inset feature simply tied to the size of the images involved? If so, that’s remarkably inflexible.

I’m going to back up Joel on this one. I think he’s right to question and re-question the image sizes. My first impression was that the old image on the left was bigger. I think it has a transparent border, and I think you purposely made the border fat enough so the inset would fit neatly in the corner. It seems to fit too exactly to be done by accident. And I think you forgot that you did it. That’s my “Sherlock Holmes” diagnosis.

If you are on a windows system, you can re-confirm this. Right click on the png or jpg image file, select properties, and then details (I think it’s called that) tab. It will tell you the image’s pixel dimensions. I would be shocked if they were the same. And if they truly are, then I’m stumped, and I’ll quietly slink away.

1 Like

Hey, thanks for your insights. Totally willing to stipulate that there is something wrong with the scaling.
What I am desperate to know is what is the theory behind what I am trying to do here? Is there some magic size I need to make this piece to get the flag to fit just right? Does that ultimately mean everyone who wants to mask pieces in this manner is limited to that size if they want to avoid an obstructed view?

With a pro-tip from @Cattlesquat, I’ve learned that Display style: Inset will apply a zoom factor of 0.5 to the image you specify.

Given that it aligns the top-left corners of the base image and mask image, I can only assume that the leftmost of the images you exhibited in the original post has a base image with some extra transparent “padding” around the edges, and the base image on the right does not (or has less, the left edges of the base and mask don’t quite line up).

How about this–instead of sharing the entire module, can you share exactly 4 images? The base counter images from the original post, plus the original and modified versions of the mask image?

1 Like

Thanks for the tips. I’ll try to get things working and if I fail I will follow up.