Class FurnitureType
A furniture type is basically a blueprint for Furniture objects. Each furniture type can create a furniture instance and the type's data will be transferred to the instance. Furniture types are automatically listed in the FurnitureTool if registered using Register(TypeSettings).
[JsonConverter(typeof(MigratingStaticJsonConverter<FurnitureType>), new object[] { typeof(FurnitureType), "PrivateTypes", true })]
public class FurnitureType : GenericDataHolder, IGenericDataHolder, IEmotionSource
- Inheritance
-
GenericDataHolderFurnitureType
- Implements
-
IGenericDataHolder
- Inherited Members
-
GenericDataHolder.GetDataKeys()
- Extension Methods
Fields
BabyBathtub
public static readonly FurnitureType BabyBathtub
Field Value
BabyBook
public static readonly FurnitureType BabyBook
Field Value
BarFrameChair
public static readonly FurnitureType BarFrameChair
Field Value
BaristaCoffeeMachine
public static readonly FurnitureType BaristaCoffeeMachine
Field Value
BigBush
public static readonly FurnitureType BigBush
Field Value
BigEmptyBowl
public static readonly FurnitureType BigEmptyBowl
Field Value
BigFoodBowl
public static readonly FurnitureType BigFoodBowl
Field Value
BigLeafPile
public static readonly FurnitureType BigLeafPile
Field Value
BigPedestal
public static readonly FurnitureType BigPedestal
Field Value
BigRocks
public static readonly FurnitureType[] BigRocks
Field Value
BigVase
public static readonly FurnitureType BigVase
Field Value
BirchTree
public static readonly FurnitureType BirchTree
Field Value
Book
public static readonly FurnitureType Book
Field Value
BookCart
public static readonly FurnitureType BookCart
Field Value
BottledSunlight
public static readonly FurnitureType BottledSunlight
Field Value
BridgeBorderEnd
public static readonly FurnitureType BridgeBorderEnd
Field Value
BridgeBorderSegment
public static readonly FurnitureType BridgeBorderSegment
Field Value
BridgeBorderStart
public static readonly FurnitureType BridgeBorderStart
Field Value
BulbFairyLights
public static readonly FurnitureType BulbFairyLights
Field Value
CafeDisplayCase
public static readonly FurnitureType CafeDisplayCase
Field Value
CafeSign
public static readonly FurnitureType CafeSign
Field Value
Cattails
public static readonly FurnitureType[] Cattails
Field Value
ChildStove
public static readonly FurnitureType ChildStove
Field Value
CloverPatch
public static readonly FurnitureType CloverPatch
Field Value
CocktailShaker
public static readonly FurnitureType CocktailShaker
Field Value
ColorfulCandles
public static readonly FurnitureType ColorfulCandles
Field Value
ColoringBook
public static readonly FurnitureType ColoringBook
Field Value
ContemporaryBar
public static readonly FurnitureType ContemporaryBar
Field Value
ContemporaryCocktailBar
public static readonly FurnitureType ContemporaryCocktailBar
Field Value
ContemporaryCounter
public static readonly FurnitureType ContemporaryCounter
Field Value
ContemporaryDoubleBed
public static readonly FurnitureType ContemporaryDoubleBed
Field Value
ContemporaryNightstand
public static readonly FurnitureType ContemporaryNightstand
Field Value
ContemporaryPaintings
public static readonly FurnitureType[] ContemporaryPaintings
Field Value
ContemporarySingleBed
public static readonly FurnitureType ContemporarySingleBed
Field Value
CounterLight
public static readonly FurnitureType CounterLight
Field Value
CountryFence
[Obsolete("Use the new FenceWall system instead")]
public static readonly FurnitureType CountryFence
Field Value
CushionedWoodworkingSofa
public static readonly FurnitureType CushionedWoodworkingSofa
Field Value
CustomPainting
public static readonly FurnitureType CustomPainting
Field Value
Cypress
public static readonly FurnitureType Cypress
Field Value
DecorativeBowls
public static readonly FurnitureType[] DecorativeBowls
Field Value
DecorativeKite
public static readonly FurnitureType DecorativeKite
Field Value
DecorativeLogPile
public static readonly FurnitureType DecorativeLogPile
Field Value
DirtyTextures
The textures that this furniture type overlays over its regular Textures when it is Dirty. If DirtyOverlayTextureName is not set, this field will be null.
public readonly IDictionary<Direction2, TextureRegion[]> DirtyTextures
Field Value
- IDictionary<Direction2, TextureRegion[]>
Doormat
public static readonly FurnitureType Doormat
Field Value
Dumbbell
public static readonly FurnitureType Dumbbell
Field Value
DumbbellRack
public static readonly FurnitureType DumbbellRack
Field Value
EdisonWoodworkingLamp
public static readonly FurnitureType EdisonWoodworkingLamp
Field Value
EmptyBowl
public static readonly FurnitureType EmptyBowl
Field Value
EmptyGlass
public static readonly FurnitureType EmptyGlass
Field Value
EmptyMug
public static readonly FurnitureType EmptyMug
Field Value
EmptyPlate
public static readonly FurnitureType EmptyPlate
Field Value
EmptyPlatter
public static readonly FurnitureType EmptyPlatter
Field Value
EvergreenTree
public static readonly FurnitureType EvergreenTree
Field Value
FancyOttoman
public static readonly FurnitureType FancyOttoman
Field Value
FistPoster
public static readonly FurnitureType FistPoster
Field Value
FlowerPatch
public static readonly FurnitureType FlowerPatch
Field Value
FoodBowl
public static readonly FurnitureType FoodBowl
Field Value
FoodGlass
public static readonly FurnitureType FoodGlass
Field Value
FoodMug
public static readonly FurnitureType FoodMug
Field Value
FoodPlate
public static readonly FurnitureType FoodPlate
Field Value
FoodPlatter
public static readonly FurnitureType FoodPlatter
Field Value
FourPostBed
public static readonly FurnitureType FourPostBed
Field Value
FrameChair
public static readonly FurnitureType FrameChair
Field Value
FullyCushionedWoodworkingSofa
public static readonly FurnitureType FullyCushionedWoodworkingSofa
Field Value
GenderPosters
public static readonly FurnitureType[] GenderPosters
Field Value
GlassDinnerTable
public static readonly FurnitureType GlassDinnerTable
Field Value
GlassJars
public static readonly FurnitureType[] GlassJars
Field Value
GlassPenCup
public static readonly FurnitureType GlassPenCup
Field Value
GlassSingleTable
public static readonly FurnitureType GlassSingleTable
Field Value
GrassPatch
public static readonly FurnitureType GrassPatch
Field Value
Gravestone
public static readonly FurnitureType Gravestone
Field Value
GrillingFood
public static readonly FurnitureType GrillingFood
Field Value
HeartsDoormat
public static readonly FurnitureType HeartsDoormat
Field Value
Hedge
public static readonly FurnitureType Hedge
Field Value
HomeworkBook
public static readonly FurnitureType HomeworkBook
Field Value
HugeRectangleRug
public static readonly FurnitureType HugeRectangleRug
Field Value
LargeContemporaryPainting
public static readonly FurnitureType LargeContemporaryPainting
Field Value
LargeOpenShelf
public static readonly FurnitureType LargeOpenShelf
Field Value
LargePotPlant
public static readonly FurnitureType[] LargePotPlant
Field Value
LargeRectangleRug
public static readonly FurnitureType LargeRectangleRug
Field Value
LargeRoundRug
public static readonly FurnitureType LargeRoundRug
Field Value
LargeWoodworkingSofa
public static readonly FurnitureType LargeWoodworkingSofa
Field Value
LavenderSachet
public static readonly FurnitureType LavenderSachet
Field Value
LavenderVase
public static readonly FurnitureType LavenderVase
Field Value
LgbtFlags
public static readonly FurnitureType[] LgbtFlags
Field Value
LightUpCase
public static readonly FurnitureType LightUpCase
Field Value
LongDinnerTable
public static readonly FurnitureType LongDinnerTable
Field Value
MagazineStack
public static readonly FurnitureType MagazineStack
Field Value
Mailbox
public static readonly FurnitureType Mailbox
Field Value
MapleFairyLights
public static readonly FurnitureType MapleFairyLights
Field Value
MapleTree
public static readonly FurnitureType MapleTree
Field Value
MixologyKit
public static readonly FurnitureType MixologyKit
Field Value
MobilePhone
public static readonly FurnitureType MobilePhone
Field Value
ModernBed
public static readonly FurnitureType ModernBed
Field Value
ModernBedsideLamp
public static readonly FurnitureType ModernBedsideLamp
Field Value
ModernChair
public static readonly FurnitureType ModernChair
Field Value
ModernCoffeeTable
public static readonly FurnitureType ModernCoffeeTable
Field Value
ModernComputer
public static readonly FurnitureType ModernComputer
Field Value
ModernCrib
public static readonly FurnitureType ModernCrib
Field Value
ModernFridge
public static readonly FurnitureType ModernFridge
Field Value
ModernLandlinePhone
public static readonly FurnitureType ModernLandlinePhone
Field Value
ModernModularCurtains
public static readonly FurnitureType[] ModernModularCurtains
Field Value
ModernShapeRug
public static readonly FurnitureType ModernShapeRug
Field Value
ModernSingleBed
public static readonly FurnitureType ModernSingleBed
Field Value
ModernSingleDiningTable
public static readonly FurnitureType ModernSingleDiningTable
Field Value
ModernSink
public static readonly FurnitureType ModernSink
Field Value
ModernStove
public static readonly FurnitureType ModernStove
Field Value
ModernTv
public static readonly FurnitureType ModernTv
Field Value
ModernTvStand
public static readonly FurnitureType ModernTvStand
Field Value
ModernWoodworkingLamp
public static readonly FurnitureType ModernWoodworkingLamp
Field Value
Mop
public static readonly FurnitureType Mop
Field Value
MuseumSign
public static readonly FurnitureType MuseumSign
Field Value
Newspaper
public static readonly FurnitureType Newspaper
Field Value
OakTree
public static readonly FurnitureType OakTree
Field Value
OldComputer
public static readonly FurnitureType OldComputer
Field Value
OrnateBed
public static readonly FurnitureType OrnateBed
Field Value
OrnateFlowerBed
public static readonly FurnitureType OrnateFlowerBed
Field Value
OrnateSingleBed
public static readonly FurnitureType OrnateSingleBed
Field Value
PaintBrush
public static readonly FurnitureType PaintBrush
Field Value
Palette
public static readonly FurnitureType Palette
Field Value
PaperPendantLight
public static readonly FurnitureType PaperPendantLight
Field Value
ParkTrashCan
public static readonly FurnitureType ParkTrashCan
Field Value
Pen
public static readonly FurnitureType Pen
Field Value
PenguinPainting
public static readonly FurnitureType PenguinPainting
Field Value
PenguinPoster
public static readonly FurnitureType PenguinPoster
Field Value
PlainCoffeeTable
public static readonly FurnitureType PlainCoffeeTable
Field Value
PlateStack
public static readonly FurnitureType PlateStack
Field Value
Pot
public static readonly FurnitureType Pot
Field Value
PotPlant
public static readonly FurnitureType PotPlant
Field Value
PreparedFood
public static readonly FurnitureType PreparedFood
Field Value
PrismaticShard
public static readonly FurnitureType PrismaticShard
Field Value
ProteinShakeKit
public static readonly FurnitureType ProteinShakeKit
Field Value
Puddle
public static readonly FurnitureType Puddle
Field Value
Puke
public static readonly FurnitureType Puke
Field Value
Puzzle
public static readonly FurnitureType Puzzle
Field Value
RainbowBunting
public static readonly FurnitureType RainbowBunting
Field Value
RainbowDoormat
public static readonly FurnitureType RainbowDoormat
Field Value
RetroChair
public static readonly FurnitureType RetroChair
Field Value
RetroClock
public static readonly FurnitureType RetroClock
Field Value
RetroDinnerTable
public static readonly FurnitureType RetroDinnerTable
Field Value
RetroDinnerTableSquare
public static readonly FurnitureType RetroDinnerTableSquare
Field Value
RetroDoubleBed
public static readonly FurnitureType RetroDoubleBed
Field Value
RetroFridge
public static readonly FurnitureType RetroFridge
Field Value
RetroSingleBed
public static readonly FurnitureType RetroSingleBed
Field Value
RetroSingleTable
public static readonly FurnitureType RetroSingleTable
Field Value
RetroSingleTableSquare
public static readonly FurnitureType RetroSingleTableSquare
Field Value
RetroSofa
public static readonly FurnitureType RetroSofa
Field Value
RetroStove
public static readonly FurnitureType RetroStove
Field Value
RetroTv
public static readonly FurnitureType RetroTv
Field Value
RhombusRug
public static readonly FurnitureType RhombusRug
Field Value
RoadSigns
public static readonly FurnitureType[] RoadSigns
Field Value
RoundCeilingLamp
public static readonly FurnitureType RoundCeilingLamp
Field Value
RoundedBackChair
public static readonly FurnitureType RoundedBackChair
Field Value
Sandbox
public static readonly FurnitureType Sandbox
Field Value
SandboxStuff
public static readonly FurnitureType SandboxStuff
Field Value
ScatteredLeaves
public static readonly FurnitureType[] ScatteredLeaves
Field Value
SelfCareBottles
public static readonly FurnitureType SelfCareBottles
Field Value
Settings
This furniture type's settings
public readonly FurnitureType.TypeSettings Settings
Field Value
SimpleBar
public static readonly FurnitureType SimpleBar
Field Value
SimpleBench
public static readonly FurnitureType SimpleBench
Field Value
SimpleBookshelf
public static readonly FurnitureType SimpleBookshelf
Field Value
SimpleCeilingLamp
public static readonly FurnitureType SimpleCeilingLamp
Field Value
SimpleChair
public static readonly FurnitureType SimpleChair
Field Value
SimpleChangingStation
public static readonly FurnitureType SimpleChangingStation
Field Value
SimpleCounter
public static readonly FurnitureType SimpleCounter
Field Value
SimpleDesk
public static readonly FurnitureType SimpleDesk
Field Value
SimpleDoubleSidedBookshelf
public static readonly FurnitureType SimpleDoubleSidedBookshelf
Field Value
SimpleDrawer
public static readonly FurnitureType SimpleDrawer
Field Value
SimpleEasel
public static readonly FurnitureType SimpleEasel
Field Value
SimpleGroundLight
public static readonly FurnitureType SimpleGroundLight
Field Value
SimpleLamp
public static readonly FurnitureType SimpleLamp
Field Value
SimpleLowTable
public static readonly FurnitureType SimpleLowTable
Field Value
SimpleNightstand
public static readonly FurnitureType SimpleNightstand
Field Value
SimpleOpenShower
public static readonly FurnitureType SimpleOpenShower
Field Value
SimplePicnicTable
public static readonly FurnitureType SimplePicnicTable
Field Value
SimplePotty
public static readonly FurnitureType SimplePotty
Field Value
SimpleShower
public static readonly FurnitureType SimpleShower
Field Value
SimpleSofa
public static readonly FurnitureType SimpleSofa
Field Value
SimpleStoneWall
[Obsolete("Use the new FenceWall system instead")]
public static readonly FurnitureType SimpleStoneWall
Field Value
SimpleToilet
public static readonly FurnitureType SimpleToilet
Field Value
SimpleWallSink
public static readonly FurnitureType SimpleWallSink
Field Value
SingleLilyPad
public static readonly FurnitureType SingleLilyPad
Field Value
SkillBooks
public static readonly Dictionary<FurnitureType, SkillType> SkillBooks
Field Value
SmallBarbecue
public static readonly FurnitureType SmallBarbecue
Field Value
SmallBlinds
public static readonly FurnitureType[] SmallBlinds
Field Value
SmallBookStack
public static readonly FurnitureType SmallBookStack
Field Value
SmallBush
public static readonly FurnitureType SmallBush
Field Value
SmallCandlestick
public static readonly FurnitureType SmallCandlestick
Field Value
SmallChimney
public static readonly FurnitureType SmallChimney
Field Value
SmallJungleGym
public static readonly FurnitureType SmallJungleGym
Field Value
SmallMirror
public static readonly FurnitureType SmallMirror
Field Value
SmallModernShapeRug
public static readonly FurnitureType SmallModernShapeRug
Field Value
SmallOpenShelf
public static readonly FurnitureType SmallOpenShelf
Field Value
SmallPicnicTable
public static readonly FurnitureType SmallPicnicTable
Field Value
SmallPlant
public static readonly FurnitureType SmallPlant
Field Value
SmallRocks
public static readonly FurnitureType SmallRocks
Field Value
SmallShovel
public static readonly FurnitureType SmallShovel
Field Value
SmallSimpleCurtain
public static readonly FurnitureType SmallSimpleCurtain
Field Value
Spanner
public static readonly FurnitureType Spanner
Field Value
Sponge
public static readonly FurnitureType Sponge
Field Value
SquareDinnerTable
public static readonly FurnitureType SquareDinnerTable
Field Value
SquareIndoorTrashCan
public static readonly FurnitureType SquareIndoorTrashCan
Field Value
SquarePlantPots
public static readonly FurnitureType[] SquarePlantPots
Field Value
StandingCoatRack
public static readonly FurnitureType StandingCoatRack
Field Value
StandingDesk
public static readonly FurnitureType StandingDesk
Field Value
StandingMirror
public static readonly FurnitureType StandingMirror
Field Value
StorageBoxSeat
public static readonly FurnitureType StorageBoxSeat
Field Value
StreetLamps
public static readonly FurnitureType[] StreetLamps
Field Value
StringBalloons
public static readonly FurnitureType StringBalloons
Field Value
StudyBook
public static readonly FurnitureType StudyBook
Field Value
Succulents
public static readonly FurnitureType[] Succulents
Field Value
Sunflowers
public static readonly FurnitureType[] Sunflowers
Field Value
SwirlWoodworkingLamp
public static readonly FurnitureType SwirlWoodworkingLamp
Field Value
TallBoxBookshelf
public static readonly FurnitureType TallBoxBookshelf
Field Value
TallCountryFence
[Obsolete("Use the new FenceWall system instead")]
public static readonly FurnitureType TallCountryFence
Field Value
TallCypress
public static readonly FurnitureType TallCypress
Field Value
TallDresser
public static readonly FurnitureType TallDresser
Field Value
TallEvergreenTree
public static readonly FurnitureType TallEvergreenTree
Field Value
TeaKit
public static readonly FurnitureType TeaKit
Field Value
Textures
The textures that this furniture type has. Each texture is automatically loaded based on the registered MLEM.Data.DataTextureAtlas instances. If a furniture type has multiple Map entries (or multiple Colors), additional texture regions will automatically be created to the right of the original texture region.
public readonly IDictionary<Direction2, TextureRegion[]> Textures
Field Value
- IDictionary<Direction2, TextureRegion[]>
TinyDinnerTable
public static readonly FurnitureType TinyDinnerTable
Field Value
ToyCar
public static readonly FurnitureType ToyCar
Field Value
TraditionalBar
public static readonly FurnitureType TraditionalBar
Field Value
TraditionalBedsideLamp
public static readonly FurnitureType TraditionalBedsideLamp
Field Value
TraditionalCeilingLight
public static readonly FurnitureType TraditionalCeilingLight
Field Value
TraditionalCounter
public static readonly FurnitureType TraditionalCounter
Field Value
TraditionalFireplace
public static readonly FurnitureType TraditionalFireplace
Field Value
TrashBag
public static readonly FurnitureType TrashBag
Field Value
Treadmill
public static readonly FurnitureType Treadmill
Field Value
TreeStumps
public static readonly FurnitureType[] TreeStumps
Field Value
Types
A list of all available furniture types. Register furniture types using Register(TypeSettings).
public static readonly ReadOnlyDictionary<string, FurnitureType> Types
Field Value
UnfinishedWoodwork
public static readonly FurnitureType UnfinishedWoodwork
Field Value
UnpreparedFood
public static readonly FurnitureType UnpreparedFood
Field Value
Vases
public static readonly FurnitureType[] Vases
Field Value
VerticalBookStack
public static readonly FurnitureType VerticalBookStack
Field Value
VerticalDumbbellRack
public static readonly FurnitureType VerticalDumbbellRack
Field Value
VerticalPlanter
public static readonly FurnitureType VerticalPlanter
Field Value
WallBalloons
public static readonly FurnitureType WallBalloons
Field Value
WashingUpStuff
public static readonly FurnitureType WashingUpStuff
Field Value
WheelieBin
public static readonly FurnitureType WheelieBin
Field Value
WideBoxBookshelf
public static readonly FurnitureType WideBoxBookshelf
Field Value
WideConsoleTable
public static readonly FurnitureType WideConsoleTable
Field Value
WildLavender
public static readonly FurnitureType WildLavender
Field Value
WindowPlants
public static readonly FurnitureType[] WindowPlants
Field Value
WinterTree
public static readonly FurnitureType WinterTree
Field Value
Wisteria
public static readonly FurnitureType[] Wisteria
Field Value
WoodenPowerPole
public static readonly FurnitureType WoodenPowerPole
Field Value
WoodenPowerPoleLine
public static readonly FurnitureType WoodenPowerPoleLine
Field Value
WoodenStool
public static readonly FurnitureType WoodenStool
Field Value
WoodenToyBox
public static readonly FurnitureType WoodenToyBox
Field Value
WoodworkingChair
public static readonly FurnitureType WoodworkingChair
Field Value
WoodworkingChairArmrests
public static readonly FurnitureType WoodworkingChairArmrests
Field Value
WoodworkingCloset
public static readonly FurnitureType WoodworkingCloset
Field Value
WoodworkingTable
public static readonly FurnitureType WoodworkingTable
Field Value
WorkoutPosters
public static readonly FurnitureType[] WorkoutPosters
Field Value
Properties
SourceString
A (localized) string that is displayed when hovering over an EmotionModifier that has this source
public string SourceString { get; }
Property Value
Methods
Construct<T>(int[], Map, Vector2, float, Guid?)
Constructs a new Furniture object from this furniture type
public T Construct<T>(int[] colors, Map map, Vector2 pos, float floor, Guid? id = null) where T : Furniture
Parameters
colors
int[]The indices of the colors that the furniture should have
map
MapThe map that the furniture should be added to
pos
Vector2The position that the furniture should have
floor
floatThe floor that the furniture should be on.
id
Guid?The id that the furniture should have, or a random one by defualt
Returns
- T
A new furniture instance of this type
Type Parameters
T
DrawColumns(Map, Vector2, float, object, Vector2, Direction2, TextureRegion, Color, float, List<Item>, bool, ParentInfo, float, SpriteEffects)
This method is a semi-overload of DrawColumns(Map, Vector2, float, object, Vector2, TextureRegion, Color, Vector2, Point, List<Item>, bool, ParentInfo, float, SpriteEffects, bool) that additionally calculates some values required for rendering furniture with certain ObjectCategory values correctly
public void DrawColumns(Map map, Vector2 position, float floor, object batch, Vector2 drawPos, Direction2 rotation, TextureRegion texture, Color color, float scale, List<StaticSpriteBatch.Item> items, bool pivot = true, ParentInfo parent = default, float depthOffset = 0, SpriteEffects effects = SpriteEffects.None)
Parameters
map
MapThe map that the object is on
position
Vector2The position that the object is on, in world space
floor
floatThe floor to draw at.
batch
objectThe sprite batch to draw with, which is either a Microsoft.Xna.Framework.Graphics.SpriteBatch or MLEM.Graphics.StaticSpriteBatch.
drawPos
Vector2The position to draw at, in draw space
rotation
Direction2The rotation that this object has, used for some calculations
texture
TextureRegionThe texture region to draw
color
ColorThe color to draw with
scale
floatThe scale to draw at
items
List<StaticSpriteBatch.Item>A list of sprite batch items that items should be added to if the
batch
is a MLEM.Graphics.StaticSpriteBatch.pivot
boolThe texture's pivot point, in texture-space pixels
parent
ParentInfoThe object's parent object
depthOffset
floatA value that is added to the calculated object's depth
effects
SpriteEffectsThe sprite effects to use when rendering
DrawDirtyOverlay(Map, Vector2, float, object, Vector2, Direction2, float, List<Item>, Color?, bool, ParentInfo, float)
Draws the DirtyTextures of this object into the world. Note that, if this object cannot get dirty, this method will throw a NullReferenceException. By default, the dirty overlay is automatically drawn by a Furniture object that is Dirty.
public void DrawDirtyOverlay(Map map, Vector2 position, float floor, object batch, Vector2 drawPos, Direction2 rotation, float scale, List<StaticSpriteBatch.Item> items, Color? overrideColor = null, bool pivot = true, ParentInfo parent = default, float depthOffset = 0)
Parameters
map
MapThe map that the object is on
position
Vector2The position that the object is on, in world space
floor
floatThe floor to draw at.
batch
objectThe sprite batch to draw with, which is either a Microsoft.Xna.Framework.Graphics.SpriteBatch or MLEM.Graphics.StaticSpriteBatch.
drawPos
Vector2The position to draw at, in draw space
rotation
Direction2The rotation that this object has, used for some calculations
scale
floatThe scale to draw at
items
List<StaticSpriteBatch.Item>A list of sprite batch items that items should be added to if the
batch
is a MLEM.Graphics.StaticSpriteBatch.overrideColor
Color?An optional color to override the default colors of the furniture
pivot
boolThe texture's pivot point, in texture-space pixels
parent
ParentInfoThe object's parent object
depthOffset
floatA value that is added to the calculated object's depth
DrawLayers(Map, Vector2, float, object, Vector2, Direction2, TextureRegion[], int[], float, List<Item>, bool, ParentInfo, Color?, float)
Draws the furniture type with the given data. Internally, this uses DrawColumns(Map, Vector2, float, object, Vector2, Direction2, TextureRegion, Color, float, List<Item>, bool, ParentInfo, float, SpriteEffects) to draw each layer with a slight depth offset.
public void DrawLayers(Map map, Vector2 position, float floor, object batch, Vector2 drawPos, Direction2 rotation, TextureRegion[] layers, int[] colors, float scale, List<StaticSpriteBatch.Item> items, bool pivot = true, ParentInfo parent = default, Color? overrideColor = null, float depthOffset = 0)
Parameters
map
MapThe map to draw the furniture type on
position
Vector2The position on the map that the furniture is at
floor
floatThe floor to draw at.
batch
objectThe sprite batch to draw with, which is either a Microsoft.Xna.Framework.Graphics.SpriteBatch or MLEM.Graphics.StaticSpriteBatch.
drawPos
Vector2The position that this furniture should be drawn at on the screen
rotation
Direction2The rotation of the furniture
layers
TextureRegion[]The textures to draw this furniture with
colors
int[]The indices in the Colors that the furniture should be drawn with
scale
floatThe scale that the furniture should be drawn with
items
List<StaticSpriteBatch.Item>A list of sprite batch items that items should be added to if the
batch
is a MLEM.Graphics.StaticSpriteBatch.pivot
boolWhether or not the furniture should be shifted by its pivot point
parent
ParentInfoThe parent that the furniture is attached to. Can be null.
overrideColor
Color?The color that should be used to draw this furniture instead of
colors
depthOffset
floatA value that is added to the depth calculation for drawing this furniture type
GetBestRotationForDrawing(Direction2)
Returns a MLEM.Maths.Direction2 that is closest to goal
, but that this object has a valid texture for, contained in Textures.
public Direction2 GetBestRotationForDrawing(Direction2 goal)
Parameters
goal
Direction2The goal rotation
Returns
- Direction2
The closest possible rotation to the goal rotation that this object has a valid texture for.
GetConstructedType()
Returns the Type that is constructed for this furniture type's Furniture instance. By default, ConstructedType is returned if it is non-null, and otherwise, BreakableFurniture, LightFurniture and Furniture are considered.
public Type GetConstructedType()
Returns
- Type
The type to construct for this furniture type's instance.
GetCoveredTiles(Vector2, Point)
Returns a rectangle that contains all of the tiles which intersect with the furniture when placed at the given position, with the given size.
public static Rectangle GetCoveredTiles(Vector2 pos, Point size)
Parameters
pos
Vector2The position to place the furniture at
size
PointThe size of the furniture
Returns
- Rectangle
A rectangle with all of the tiles that are covered
GetDisplayName(Furniture)
Returns this furniture item's display name, optionally based on the given Furniture instance
.
public string GetDisplayName(Furniture instance)
Parameters
instance
FurnitureThe furniture instance to get the name for, or null to get the default name.
Returns
- string
This furniture item's display name.
GetReferenceTexture(Direction2?)
Returns the reference texture of this furniture type for the given rotation. The reference texture is the first layer of the texture for the given rotation.
public TextureRegion GetReferenceTexture(Direction2? rotation = null)
Parameters
rotation
Direction2?The rotation to get the reference texture for. Defaults to DefaultRotation.
Returns
- TextureRegion
The reference texture for the given rotation
GetRotatedOffset(Vector2, Direction2, Direction2)
Returns the rotated offset of the given position, based on this furniture type's Size. This method is used to offset the position of furniture objects based on their (visual) rotation.
public Vector2 GetRotatedOffset(Vector2 offset, Direction2 objectRotation, Direction2 rotation)
Parameters
offset
Vector2The offset position to rotate
objectRotation
Direction2The original rotation of the object
rotation
Direction2The rotation to rotate by
Returns
- Vector2
The rotated offset of the
offset
GetSize(Direction2)
Returns the Size of this furniture type, modified based on the given rotation.
public Point GetSize(Direction2 rotation)
Parameters
rotation
Direction2The rotation to return the size for
Returns
- Point
The modified size
GetTexture(string, bool)
Returns a MLEM.Textures.TextureRegion with the given name, based on all of the textures in the base game and all GetCustomFurnitureTextures(ModInfo) textures.
public static TextureRegion GetTexture(string name, bool throwIfNotFound = true)
Parameters
name
stringThe name of the texture to get
throwIfNotFound
boolWhether an exception should be thrown if the texture is not found
Returns
- TextureRegion
A texture region with the given name, or null if there is none
GetTextures(string, int, Func<Direction2, bool>)
Create a dictionary of textures for all MLEM.Maths.Direction2Helper.Adjacent directions that have a texture registered for them. Textures are gathered using GetCustomFurnitureTextures(ModInfo), and textures need to be suffixed with the direction's string to be recognized. This method is used for furniture of all kinds.
public static Dictionary<Direction2, TextureRegion[]> GetTextures(string name, int amount = 1, Func<Direction2, bool> shouldThrow = null)
Parameters
name
stringThe name of the texture to load
amount
intThe amount of layers the texture has
shouldThrow
Func<Direction2, bool>Whether an exception should be thrown if the texture is not found
Returns
- Dictionary<Direction2, TextureRegion[]>
A dictionary of directions to texture layers
HasCategory(ObjectCategory)
Returns whether this type's Settings have any of the supplied ObjectCategory values
public bool HasCategory(ObjectCategory category)
Parameters
category
ObjectCategoryThe categories to query
Returns
- bool
Whether any of the passed categories are present
Register(TypeSettings)
Registers a custom furniture type
public static FurnitureType Register(FurnitureType.TypeSettings settings)
Parameters
settings
FurnitureType.TypeSettingsThe settings to apply to the custom furniture type
Returns
- FurnitureType
The registered furniture type
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.