mirror of
https://github.com/Ellpeck/TinyLifeExampleMod.git
synced 2024-11-22 03:53:29 +01:00
pad textures by default
This commit is contained in:
parent
c068b255a5
commit
0a018706e4
1 changed files with 5 additions and 4 deletions
|
@ -113,10 +113,11 @@ public class ExampleMod : Mod {
|
|||
|
||||
// loads a texture atlas with the given amount of separate texture regions in the x and y axes
|
||||
// we submit it to the texture packer to increase rendering performance. The callback is invoked once packing is completed
|
||||
texturePacker.Add(new UniformTextureAtlas(content.Load<Texture2D>("CustomTops"), 4, 11), r => this.customTops = r);
|
||||
texturePacker.Add(new UniformTextureAtlas(content.Load<Texture2D>("CustomHairs"), 4, 5), r => this.customHairs = r);
|
||||
texturePacker.Add(new UniformTextureAtlas(content.Load<Texture2D>("CustomBottomsShoes"), 8, 6), r => this.customBottoms = r);
|
||||
texturePacker.Add(new UniformTextureAtlas(content.Load<Texture2D>("UiTextures"), 8, 8), r => this.uiTextures = r);
|
||||
// additionally, we pad all texture regions by 1 pixel, so that rounding errors during rendering don't cause visual artifacts
|
||||
texturePacker.Add(new UniformTextureAtlas(content.Load<Texture2D>("CustomTops"), 4, 11), r => this.customTops = r, 1, true);
|
||||
texturePacker.Add(new UniformTextureAtlas(content.Load<Texture2D>("CustomHairs"), 4, 5), r => this.customHairs = r, 1, true);
|
||||
texturePacker.Add(new UniformTextureAtlas(content.Load<Texture2D>("CustomBottomsShoes"), 8, 6), r => this.customBottoms = r, 1, true);
|
||||
texturePacker.Add(new UniformTextureAtlas(content.Load<Texture2D>("UiTextures"), 8, 8), r => this.uiTextures = r, 1, true);
|
||||
// wallpaper textures require special treatment to work with openings, the x and y values are passed to the UniformTextureAtlas constructor
|
||||
WallMode.ApplyMasks(content.Load<Texture2D>("Wallpapers"), 4, 5, texturePacker, r => this.wallpaperTextures = r);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue