Opening - Ellpeck/TinyLifeExampleMod Wiki

Tiny Life


Opening Class

An opening is some sort of extrusion in a Wall, like a window or a door.
Openings are created from their underlying OpeningType.

public class Opening :

Inheritance System.Object 🡒 Opening


Implements IPricedObject


Opening.Opening(OpeningType, int) Constructor

Creates a new opening from the given opening type and color

public Opening(TinyLife.World.OpeningType type, int color);


type OpeningType
The opening type

color System.Int32
The index of the color


Opening.Color Field

The index of the OpeningType's ColorScheme that this opening instance has

public readonly int Color;

Field Value


Opening.Type Field

The OpeningType that this opening has

public readonly OpeningType Type;

Field Value



Opening.CanWalkThrough(Wall, Person) Method

Returns whether a Person is able to walk through a Wall that has this opening.
This returns true for Door and SwingingDoor and false for Opening.

public virtual bool CanWalkThrough(TinyLife.World.Wall wall, TinyLife.Objects.Person person);


wall Wall

person Person



Opening.Draw(GameTime, SpriteBatch, Map, Wall, Vector2, bool, float, float, Nullable<Color>) Method

Draws this opening in the world with the given settings

public virtual void Draw(Microsoft.Xna.Framework.GameTime time, Microsoft.Xna.Framework.Graphics.SpriteBatch batch, TinyLife.World.Map map, TinyLife.World.Wall wall, Microsoft.Xna.Framework.Vector2 drawPos, bool vertical, float scale, float depth, System.Nullable<Microsoft.Xna.Framework.Color> overrideColor);


time Microsoft.Xna.Framework.GameTime
The game's time

batch Microsoft.Xna.Framework.Graphics.SpriteBatch
The sprite batch to use for drawing

map Map
The map that the opening is on

wall Wall
The wall that the opening is in

drawPos Microsoft.Xna.Framework.Vector2
The position, in screen space, to draw the opening on

vertical System.Boolean
Whether the wall that the opening is on is vertical

scale System.Single
The scale to draw the opening with

depth System.Single
The depth to use for drawing the opening

overrideColor System.Nullable<Microsoft.Xna.Framework.Color>
A color that should be used instead of this opening's default color, or null to use the opening's default color

Opening.GetPrice() Method

Returns the price that this object can be bought or sold for.
Note that, like in the case of the Painting, the returned price isn't necessarily the full price that the object can be sold for. Instead, the price returned here should be the price that this object has when bought or sold from the FurnitureTool or similar.

public float GetPrice();


The object's price

Implements GetPrice()

Opening.IsWindow() Method

Whether the opening is a window that objects with the CanCoverWindow category can be attached to

public virtual bool IsWindow();


Whether the opening is a window