Item Glow Mask Library

Item Glow Mask Library

Unleash Your Items’ Inner Radiance with Item Glow Mask Library for tModLoader

Tired of your custom items and armor blends blending into the background? For tModLoader modders seeking to add that extra visual flair, the Item Glow Mask Library mod is an indispensable tool. This powerful, yet simple, library streamlines the process of implementing custom glow effects, allowing your creations to truly shine.

Say Goodbye to Inefficient Glows

Historically, adding glow effects to modded content often involved complex workarounds, such as creating new player and item sprite layers. This approach, while functional, could lead to less efficient code and potential compatibility issues. The Item Glow Mask Library elegantly sidesteps these problems by directly integrating with tModLoader’s core functionality. It modifies `TextureAssets.GlowMask` and `Item.glowMask` to accept your custom glow textures, all while leveraging the game’s native glow mask rendering code. This ensures both visual consistency and robust compatibility with other mods.

Effortless Implementation for Modders

Integrating the Item Glow Mask Library into your own tModLoader projects is remarkably straightforward. The mod provides clear instructions for incorporating it into your mod’s build and code.

  • Mod References: Simply add `GlowMask` to your mod’s `modReferences` list in your `build.txt` file.
  • Initialization: In your `Mod.cs` file’s `Load()` function, call `GlowMask.GlowMask.RegisterGlowMasks(this);` to initialize the library.
  • Texture Creation: For items, create a `_Glow` version of your item’s sprite texture (e.g., `YourItemSprite.png` and `YourItemSprite_Glow.png`).
  • Armor Integration: Similarly, for armor pieces, append `_Glow` to the existing sprite names (e.g., `YourArmorSprite_Head_Glow.png`).

Advanced Customization

Beyond the basic glow implementation, the Item Glow Mask Library offers advanced control. You can easily override the default glow mask color for armor items directly within your `ModItem` class’s `SetDefaults()` method by using `GlowMask.GlowMask.OverrideArmorGlowColor(this, whateverColorYouWant);`. This allows for even greater personalization of your modded gear.

With the Item Glow Mask Library, adding captivating glow effects to your tModLoader creations is no longer a technical hurdle. Empower your items and armor with a visual distinction that players are sure to appreciate.

Known Limitations

It’s important to note that, due to limitations in the underlying vanilla rendering code, animated textures are not currently supported for glow masks.

Leave a Reply