Class Painting
A furniture is an instance of a FurnitureType which is placed in the world, or in a Person's hand. To register a custom furniture, use Register(FurnitureType.TypeSettings).
Inherited Members
Namespace: TinyLife.Objects
Assembly: Tiny Life.dll
Syntax
public class Painting : Furniture, IGenericDataHolder, IPricedObject
Constructors
Painting(Guid, FurnitureType, Int32[], Map, Vector2)
Creates a new furniture instance. By default, this is done using Construct<T>(Int32[], Map, Vector2, Nullable<Guid>).
Declaration
public Painting(Guid id, FurnitureType type, int[] colors, Map map, Vector2 pos)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | id | The id to apply to the created furniture instance |
FurnitureType | type | The type to create an instance of |
System.Int32[] | colors | The colors to apply to the furniture |
Map | map | The map to create the furniture on |
Microsoft.Xna.Framework.Vector2 | pos | The position that the furniture should have |
Fields
EmitsCreativeEmotion
Stores whether this painting emits a Creative EmotionModifier when people are in the same room as it. This field is used by the PerfectPainter award personality.
Declaration
[DataMember]
public bool EmitsCreativeEmotion
Field Value
Type | Description |
---|---|
System.Boolean |
PaintingType
The type of painting that this object displays
Declaration
[DataMember]
public PaintingType PaintingType
Field Value
Type | Description |
---|---|
PaintingType |
Progress
The progress that has been done on this painting by the Creator so far. This value defaults to 1, which is 100%.
Declaration
[DataMember]
public float Progress
Field Value
Type | Description |
---|---|
System.Single |
Methods
Draw(GameTime, Object, Vector2, Vector2, Nullable<Color>, Direction2, Int32[], Single, Boolean, ParentInfo, Single, Boolean, List<StaticSpriteBatch.Item>)
Draws this furniture in the world with the given settings. This is a more generalized version of Draw(GameTime, Object, Vector2, Nullable<Color>, List<StaticSpriteBatch.Item>)
Declaration
public override void Draw(GameTime time, object batch, Vector2 pos, Vector2 drawPos, Color? overrideColor, Direction2 rotation, int[] colors, float drawScale, bool pivot, ParentInfo parent, float depthOffset, bool held, List<StaticSpriteBatch.Item> items)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.Xna.Framework.GameTime | time | The game time |
System.Object | batch | The sprite batch to draw with, which is either a Microsoft.Xna.Framework.Graphics.SpriteBatch or MLEM.Graphics.StaticSpriteBatch. |
Microsoft.Xna.Framework.Vector2 | pos | The position, in world space, that the furniture is at |
Microsoft.Xna.Framework.Vector2 | drawPos | The position, in draw space, to draw the furniture at |
System.Nullable<T><Microsoft.Xna.Framework.Color> | overrideColor | An optional color to override the default colors of the furniture |
MLEM.Misc.Direction2 | rotation | The rotation of the furniture |
System.Int32[] | colors | The colors to draw the furniture with |
System.Single | drawScale | The scale to draw the furniture with |
System.Boolean | pivot | Whether or not to move the furniture by its texture's pivot point |
ParentInfo | parent | The object that this furniture is latched on to, or null if there is none |
System.Single | depthOffset | A value that is added onto the calculated depth of the object |
System.Boolean | held | Whether or not this item is currently being held by a Person |
System.Collections.Generic.List<T><StaticSpriteBatch.Item> | items | A list of sprite batch items that items should be added to if the |
Overrides
GetDescription(List<String>, Boolean)
This method allows adding a set of strings to the description
list that get displayed when the object is hovered over in the build mode or household storage UIs.
By default, this method adds various strings related to the ElectricityRating, Quality, Creator, and also invokes the OnGetDescription event.
Declaration
public override void GetDescription(List<string> description, bool forHoverInfo)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<T><System.String> | description | The description to add to. |
System.Boolean | forHoverInfo |
Overrides
GetPrice()
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.
Declaration
public override float GetPrice()
Returns
Type | Description |
---|---|
System.Single | The object's price |
Overrides
Validate()
This method is called when this object is loaded from disk. Returning false on this method causes the object to be removed from the map. By default, this method invokes OnValidated and OnEventsAttachable.
Declaration
public override bool Validate()
Returns
Type | Description |
---|---|
System.Boolean | false if the object is not valid, true otherwise |