New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Action Library Transparency #161

Closed
RobertBColton opened this Issue Nov 3, 2014 · 8 comments

Comments

Projects
None yet
2 participants
@RobertBColton
Collaborator

RobertBColton commented Nov 3, 2014

Apparently LGM does not recognize the transparency when loading GM *.lib action libraries. I really feel this is a mistake and that since LGM knows when it is loading GM's format it should properly recognize the transparency. I tested with the following Action Library
http://gmc.yoyogames.com/index.php?showtopic=286088
GameMaker Action Library

@IsmAvatar

This comment has been minimized.

Show comment
Hide comment
@IsmAvatar

IsmAvatar Nov 3, 2014

Owner

This seems like a regression, or else those lib files are doing something differently.

Owner

IsmAvatar commented Nov 3, 2014

This seems like a regression, or else those lib files are doing something differently.

@RobertBColton

This comment has been minimized.

Show comment
Hide comment
@RobertBColton

RobertBColton Nov 3, 2014

Collaborator

@IsmAvatar I can confirm that this is not a regression and existed in lgm16b4

I believe I already know the cause, I bet you're taking the transparency pixel from the top left corner and I bet GM takes it from the bottom left corner like it does for sprites. I will proceed with additional testing.

lgm16b4 reproduces the issue

Collaborator

RobertBColton commented Nov 3, 2014

@IsmAvatar I can confirm that this is not a regression and existed in lgm16b4

I believe I already know the cause, I bet you're taking the transparency pixel from the top left corner and I bet GM takes it from the bottom left corner like it does for sprites. I will proceed with additional testing.

lgm16b4 reproduces the issue

@IsmAvatar

This comment has been minimized.

Show comment
Hide comment
@IsmAvatar

IsmAvatar Nov 3, 2014

Owner

Really? Derp. I thought I would have tested that.

Owner

IsmAvatar commented Nov 3, 2014

Really? Derp. I thought I would have tested that.

@RobertBColton

This comment has been minimized.

Show comment
Hide comment
@RobertBColton

RobertBColton Nov 3, 2014

Collaborator

@IsmAvatar I have resolved the issue in ae0dc20, it was a 1 line fix and also cleaned up some unused imports. The solution was to remove the transparency in the LibManager because if it were done in the ActionEditor it would break the LGL icons which use actual transparency and don't currently have any padding in their images, they utilize the full extents of their image. The only problem with this is that if in the future LGM ever writes action libraries for whatever reason LIB action libraries will obviously have the transparency color removed when written, and I added a comment in a603793 to make sure this is noted. If you are satisfied with the solution we can close this ticket when I release the new version on the forums after I address some other issues.

Action Library Transparency

I can also confirm that the action libraries in Studio are still compatible with LateralGM.

Studio Lib Compatibility

Collaborator

RobertBColton commented Nov 3, 2014

@IsmAvatar I have resolved the issue in ae0dc20, it was a 1 line fix and also cleaned up some unused imports. The solution was to remove the transparency in the LibManager because if it were done in the ActionEditor it would break the LGL icons which use actual transparency and don't currently have any padding in their images, they utilize the full extents of their image. The only problem with this is that if in the future LGM ever writes action libraries for whatever reason LIB action libraries will obviously have the transparency color removed when written, and I added a comment in a603793 to make sure this is noted. If you are satisfied with the solution we can close this ticket when I release the new version on the forums after I address some other issues.

Action Library Transparency

I can also confirm that the action libraries in Studio are still compatible with LateralGM.

Studio Lib Compatibility

@RobertBColton

This comment has been minimized.

Show comment
Hide comment
@RobertBColton

RobertBColton Nov 4, 2014

Collaborator

@IsmAvatar I can also confirm the following.
The bottom left pixel color of the 32x32 image specifies the transparency color.
From the official Mark Overmars library maker manual.
http://sandbox.yoyogames.com/make/extensions
And from this website.
http://gm6guide.altervista.org/phpBB2/viewtopic.php?t=621&sid=9c170ce54a333371ae972b8dbcab3dda

General Action Information
...Next there is the Image that represents the action. This must be a 32x32 image but the actual image should only be 24x24. (This sounds a bit stupid but this is due to the fact that normally 32x32 icons are used for this.) The bottom left pixel color of the 32x32 image specifies the transparency color. The three basic images for normal actions, drawing actions, and questions are included in the folder Action_Images. You might want to use these as the basis for your images to give the actions a consistent look.

Collaborator

RobertBColton commented Nov 4, 2014

@IsmAvatar I can also confirm the following.
The bottom left pixel color of the 32x32 image specifies the transparency color.
From the official Mark Overmars library maker manual.
http://sandbox.yoyogames.com/make/extensions
And from this website.
http://gm6guide.altervista.org/phpBB2/viewtopic.php?t=621&sid=9c170ce54a333371ae972b8dbcab3dda

General Action Information
...Next there is the Image that represents the action. This must be a 32x32 image but the actual image should only be 24x24. (This sounds a bit stupid but this is due to the fact that normally 32x32 icons are used for this.) The bottom left pixel color of the 32x32 image specifies the transparency color. The three basic images for normal actions, drawing actions, and questions are included in the folder Action_Images. You might want to use these as the basis for your images to give the actions a consistent look.

@RobertBColton

This comment has been minimized.

Show comment
Hide comment
@RobertBColton

RobertBColton Nov 13, 2014

Collaborator

@IsmAvatar I came up with a better solution in 7ce0674 and c00edb3. I also added caching in 256f932

I now store whether the action has a transparency key which is true if it is loaded from the LIB format, so this allows them to coexist peacefully, render properly, and even be written back to the disk. If you are satisfied with this solution we can close this ticket.

The only remaining issue is the spacing, it seems that GM automatically removes the whitespace.
Custom Action Lists LIB Format
GameMaker Removes Action Image Whitespace

Collaborator

RobertBColton commented Nov 13, 2014

@IsmAvatar I came up with a better solution in 7ce0674 and c00edb3. I also added caching in 256f932

I now store whether the action has a transparency key which is true if it is loaded from the LIB format, so this allows them to coexist peacefully, render properly, and even be written back to the disk. If you are satisfied with this solution we can close this ticket.

The only remaining issue is the spacing, it seems that GM automatically removes the whitespace.
Custom Action Lists LIB Format
GameMaker Removes Action Image Whitespace

@RobertBColton

This comment has been minimized.

Show comment
Hide comment
@RobertBColton

RobertBColton Jan 25, 2016

Collaborator

After working to resolve this for 16b5 in #240 I determined that the actions are actually supposed to be cropped as the quote from the manual in the original Action Library Maker by Overmars states. LGL also crops its images to 24x24 as that quote states, but I am confused why a 32x32 image is used when only 24x24 pixels of each one are used?

act.actImage = Util.getTransparentIcon(
                    ImageIO.read(new ByteArrayInputStream(data))).getSubimage(0,0,24,24);

Using this version allows LGM's library actions and custom GM action libraries to be placed side by side in the action list with no additional whitespace. I believe this is the correct behavior.
GM Action Library Fix

Collaborator

RobertBColton commented Jan 25, 2016

After working to resolve this for 16b5 in #240 I determined that the actions are actually supposed to be cropped as the quote from the manual in the original Action Library Maker by Overmars states. LGL also crops its images to 24x24 as that quote states, but I am confused why a 32x32 image is used when only 24x24 pixels of each one are used?

act.actImage = Util.getTransparentIcon(
                    ImageIO.read(new ByteArrayInputStream(data))).getSubimage(0,0,24,24);

Using this version allows LGM's library actions and custom GM action libraries to be placed side by side in the action list with no additional whitespace. I believe this is the correct behavior.
GM Action Library Fix

@RobertBColton

This comment has been minimized.

Show comment
Hide comment
@RobertBColton

RobertBColton Feb 5, 2016

Collaborator

This is now fully resolved in both master and stable. Please review #245 for more information.

Collaborator

RobertBColton commented Feb 5, 2016

This is now fully resolved in both master and stable. Please review #245 for more information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment