Class WallMode
A wall mode is a way that a Wall's wallpaper can be displayed. Each wall mode represents a cutout that hides certain parts of a wall for an Opening or Roof to be displayed there.
public class WallMode
- Inheritance
-
WallMode
- Inherited Members
- Extension Methods
Constructors
WallMode(string, UniformTextureAtlas, Point, UniformTextureAtlas, Point?)
Creates a new wall mode with the given mask settings. Each pixel on the mask that is non-transparent will be removed from the Wallpaper.
public WallMode(string name, UniformTextureAtlas maskTexture, Point maskPosition, UniformTextureAtlas downMaskTexture = null, Point? downMaskPosition = null)
Parameters
name
stringThe name of this wall mode.
maskTexture
UniformTextureAtlasThe texture that is used as a mask when masking Wallpaper using TinyLife.World.WallMode.MaskWallpaper(MLEM.Textures.TextureExtensions.TextureData, MLEM.Textures.TextureExtensions.TextureData, MLEM.Textures.TextureExtensions.TextureData, Microsoft.Xna.Framework.Point, Microsoft.Xna.Framework.Point, Microsoft.Xna.Framework.Point, Microsoft.Xna.Framework.Point).
maskPosition
PointThe position on the MaskTexture that the mask is at, in texture region coordinates similar to MLEM.Textures.UniformTextureAtlas.
downMaskTexture
UniformTextureAtlasThe texture that is used as a mask for the "down" version of this wall mode when using TinyLife.World.WallMode.MaskWallpaper(MLEM.Textures.TextureExtensions.TextureData, MLEM.Textures.TextureExtensions.TextureData, MLEM.Textures.TextureExtensions.TextureData, Microsoft.Xna.Framework.Point, Microsoft.Xna.Framework.Point, Microsoft.Xna.Framework.Point, Microsoft.Xna.Framework.Point). If null, this defaults to the default mask texture.
downMaskPosition
Point?The position on the DownMaskTexture that the mask for the "down" version of this wall mode is at, in texture region coordinates similar to MLEM.Textures.UniformTextureAtlas. If null, this defaults to the default "down" mask position.
Fields
Door
A wall mode that represents a wall with a door-shaped hole in it
public static readonly WallMode Door
Field Value
DownMaskPosition
The position on the DownMaskTexture that the mask for the "down" version of this wall mode is at, in texture region coordinates similar to MLEM.Textures.UniformTextureAtlas. Each pixel on the mask that is non-transparent will be removed from the "down" version of the Wallpaper.
public readonly Point DownMaskPosition
Field Value
- Point
DownMaskTexture
The texture that is used as a mask for the "down" version of this wall mode when using TinyLife.World.WallMode.MaskWallpaper(MLEM.Textures.TextureExtensions.TextureData, MLEM.Textures.TextureExtensions.TextureData, MLEM.Textures.TextureExtensions.TextureData, Microsoft.Xna.Framework.Point, Microsoft.Xna.Framework.Point, Microsoft.Xna.Framework.Point, Microsoft.Xna.Framework.Point). Each pixel on the mask that is non-transparent will be removed from the "down" version of the Wallpaper.
public readonly UniformTextureAtlas DownMaskTexture
Field Value
- UniformTextureAtlas
Full
A wall mode that represents a wall that is rendered in full, without any holes in it
public static readonly WallMode Full
Field Value
FullSizeWindow
A full-size window that leaves almost none of the wall, except for a small sliver at the top.
public static readonly WallMode FullSizeWindow
Field Value
LongWindow
A long window with a similar width to SmallWindow
public static readonly WallMode LongWindow
Field Value
MaskPosition
The position on the MaskTexture that the mask is at, in texture region coordinates similar to MLEM.Textures.UniformTextureAtlas. Each pixel on the mask that is non-transparent will be removed from the Wallpaper.
public readonly Point MaskPosition
Field Value
- Point
MaskTexture
The texture that is used as a mask when masking Wallpaper using TinyLife.World.WallMode.MaskWallpaper(MLEM.Textures.TextureExtensions.TextureData, MLEM.Textures.TextureExtensions.TextureData, MLEM.Textures.TextureExtensions.TextureData, Microsoft.Xna.Framework.Point, Microsoft.Xna.Framework.Point, Microsoft.Xna.Framework.Point, Microsoft.Xna.Framework.Point). Each pixel on the mask that is non-transparent will be removed from the Wallpaper.
public readonly UniformTextureAtlas MaskTexture
Field Value
- UniformTextureAtlas
Modes
The registered wall modes, both by mods and the game itself.
public static readonly ReadOnlyDictionary<string, WallMode> Modes
Field Value
Name
The name of this wall mode.
public readonly string Name
Field Value
NarrowLong
A long window with a very low width and the same length as LongWindow.
public static readonly WallMode NarrowLong
Field Value
NarrowWideTop
A bathroom-style window that is high up on the wall and wide but not very tall.
public static readonly WallMode NarrowWideTop
Field Value
OutlineOnly
A full-size window that leaves almost none of the wall, just a one-pixel outline around the whole wall.
public static readonly WallMode OutlineOnly
Field Value
Roof
A wall mode that represents a wall used on the faces of a Roof that are straight
public static readonly WallMode Roof
Field Value
RoofGable
A wall mode that represents a wall used on the faces of a Roof that are gabled
public static readonly WallMode RoofGable
Field Value
RoofGableInverse
A wall mode that represents a wall used on the faces of a Roof that are gabled in the opposite direction as RoofGable
public static readonly WallMode RoofGableInverse
Field Value
SmallWindow
A wall mode that represents a wall with a small, rectanglular window in it
public static readonly WallMode SmallWindow
Field Value
StairsBottom
A wall mode that represents the triangle-like areas at the bottom half of Stairs.
public static readonly WallMode[] StairsBottom
Field Value
- WallMode[]
StairsTop
A wall mode that represents the triangle-like areas at the bottom half of Stairs.
public static readonly WallMode[] StairsTop
Field Value
- WallMode[]
Methods
ApplyMasks(Texture2D, int, int, RuntimeTexturePacker, Action<Dictionary<Point, TextureRegion>>)
Applies the game's predefined wallpaper maskings (based on WallMode) to the given wallpaper texture. When adding custom Wallpaper types, this method should be used.
public static UniformTextureAtlas ApplyMasks(Texture2D wallpapers, int regionAmountX, int regionAmountY, RuntimeTexturePacker packer = null, Action<Dictionary<Point, TextureRegion>> result = null)
Parameters
wallpapers
Texture2DThe texture to mask
regionAmountX
intThe amount of texture regions on the x axis
regionAmountY
intThe amount of texture regions on the y axis
packer
RuntimeTexturePackerThe texture packer to pack the resulting texture with, or null to skip packing the texture
result
Action<Dictionary<Point, TextureRegion>>A function that is called when the
packer
packed the masked texture, which yields the resulting texture atlas
Returns
- UniformTextureAtlas
OffsetTextureRegion(Point, bool, bool)
Offsets the given texture region based on this wall mode, causing the returned texture region to contain the same Wallpaper, but with this wall mode's cutout.
public Point OffsetTextureRegion(Point region, bool vertical, bool isDown)
Parameters
region
PointThe texture region location to offset.
vertical
boolWhether the texture region location returned should be a vertical wall.
isDown
boolWhether the texture region location returned should be in the Down display mode.
Returns
- Point
The offset texture region position.
Register(WallMode)
public static WallMode Register(WallMode mode)
Parameters
mode
WallModeThe mode to register.
Returns
- WallMode
The
mode
passed, for chaining.