TinyLifeExampleMod/Api/TinyLife/World/Wallpaper.md

4.1 KiB

Wallpaper

Namespace: TinyLife > World

Assembly: Tiny Life.dll

Implements IPricedObject

Summary

A wallpaper is a single-instanced object that can be attached to a TinyLife.World.Wall, which makes the wall render a different texture. To register custom wallpapers, use TinyLife.World.Wallpaper.Register(System.String,System.Int32,MLEM.Textures.UniformTextureAtlas,Microsoft.Xna.Framework.Point,TinyLife.Utilities.ColorScheme,MLEM.Textures.TextureRegion). Note that registered wallpapers need to use a texture generated by TinyLife.Utilities.TextureHandler.ApplyWallpaperMasks(Microsoft.Xna.Framework.Graphics.Texture2D,System.Int32,System.Int32,System.Action{MLEM.Textures.UniformTextureAtlas}).

Fields

Type Name Summary
String BaseName The name of this type of wallpaper. Whereas TinyLife.World.Wallpaper.Name has the index of its TinyLife.World.Wallpaper.color appended to it, this one is just the type's name.
ColorScheme ColorScheme The TinyLife.World.Wallpaper.ColorScheme that this wallpaper type uses
TextureRegion Icon The build mode icon for this object, which represents the category / theme / mod that it comes from. If this value is nonnull, the icon will be displayed in the corner of the build mode button for this object.
String Name The name of this specific wallpaper. This is comprised of the TinyLife.World.Wallpaper.BaseName with the TinyLife.World.Wallpaper.color's index attached to it.
Int32 Price The price of this wallpaper. Can be retrieved easily using TinyLife.World.Wallpaper.GetPrice.

Methods

Return Name Summary
void Draw ( GameTime, SpriteBatch, Vector2, WallMode, Boolean, Boolean, Single, Single, Boolean ) Draws this wallpaper on the given wall with the given data.
void DrawUi ( Element, SpriteBatch, GameTime, Single ) Draws this wallpaper on the given MLEM.Ui.Elements.Element in ui space
Single GetPrice ( )

Static Fields

Type Name Summary
IDictionary<String, Wallpaper[]> Wallpapers The registry for all TinyLife.World.Wallpaper objects in the game and mods. Use TinyLife.World.Wallpaper.Register(System.String,System.Int32,MLEM.Textures.UniformTextureAtlas,Microsoft.Xna.Framework.Point,TinyLife.Utilities.ColorScheme,MLEM.Textures.TextureRegion) to register custom wallpapers.

Static Methods

Return Name Summary
void Register ( String, Int32, UniformTextureAtlas, Point, ColorScheme, TextureRegion ) Creates and registers a new wallpaper with the given settings. Note that the `` should be one generated using TinyLife.Utilities.TextureHandler.ApplyWallpaperMasks(Microsoft.Xna.Framework.Graphics.Texture2D,System.Int32,System.Int32,System.Action{MLEM.Textures.UniformTextureAtlas}), as otherwise, graphical issues will occur.