Search Results for

    Show / Hide Table of Contents

    Class FurnitureTool

    A tool is a type of game mode that is currently active. Tools are split up into the PlayModeTool and BuildTools, the latter of which holds all tools that can be found in the build menu.

    Inheritance
    System.Object
    Tool
    FurnitureTool
    Inherited Members
    Tool.RemoveTool
    Tool.MoveTool
    Tool.PlayModeTool
    Tool.BuildTools
    Tool.SelectedObject
    Tool.SelectedWall
    Tool.SelectedRoof
    Tool.IsRotateCwPressed
    Tool.IsRotateCcwPressed
    Tool.IsCopyPressed
    Tool.OnOpened
    Tool.OnClosed
    Tool.OnUpdate
    Tool.OnDraw
    Tool.OnInitBuildModeUi
    Tool.Input
    Tool.Map
    Tool.Money
    Tool.Texture
    Tool.DisplayAsTab
    Tool.MousePos
    Tool.Opened()
    Tool.ForceWallsUp()
    Tool.CanSwitchGameModes()
    Tool.CanUndoRedo()
    Tool.OnButtonCreated(Button)
    Tool.IsOnLot(Point)
    Tool.ColorSelection(ColorScheme[], Action<Int32, Int32>, Func<Int32, Int32, Boolean>)
    Tool.ColorSelection(ColorScheme, Action<Int32>, Func<Int32, Boolean>)
    Tool.BuildModeButton(String, Element.GenericCallback, Element.DrawCallback, Single, TextureRegion, IEnumerable<String>, Nullable<Single>)
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: TinyLife.Tools
    Assembly: Tiny Life.dll
    Syntax
    public class FurnitureTool : Tool

    Constructors

    FurnitureTool()

    Declaration
    public FurnitureTool()

    Methods

    Closed()

    Called when this build tool is closed. By default, this method removes its elements from the ui.

    Declaration
    public override void Closed()
    Overrides
    Tool.Closed()

    Draw(GameTime, SpriteBatch)

    This method is called every draw frame for the CurrentTool. Note that this method is only called if the mouse is not hovering over any ui elements. By default, this method invokes OnDraw.

    Declaration
    public override void Draw(GameTime time, SpriteBatch batch)
    Parameters
    Type Name Description
    Microsoft.Xna.Framework.GameTime time

    The game's time

    Microsoft.Xna.Framework.Graphics.SpriteBatch batch

    The sprite batch used for drawing

    Overrides
    Tool.Draw(GameTime, SpriteBatch)

    GetMouseCursor()

    Returns the CursorType that this tool should currently display. By default, Default is returned.

    Declaration
    public override CursorType GetMouseCursor()
    Returns
    Type Description
    CursorType

    The cursor type

    Overrides
    Tool.GetMouseCursor()

    InitBuildModeUi(Panel, Panel)

    Override this method to add custom content to the passed ui elements. By default, this method does nothing.

    Declaration
    protected override void InitBuildModeUi(Panel content, Panel zoom)
    Parameters
    Type Name Description
    MLEM.Ui.Elements.Panel content

    The main content panel. Add custom BuildModeButton(String, Element.GenericCallback, Element.DrawCallback, Single, TextureRegion, IEnumerable<String>, Nullable<Single>) instances here.

    MLEM.Ui.Elements.Panel zoom

    The zoom panel that contains ColorSelection(ColorScheme[], Action<Int32, Int32>, Func<Int32, Int32, Boolean>) and object previews

    Overrides
    Tool.InitBuildModeUi(Panel, Panel)

    ShouldHighlightSelectedObject(Object)

    Whether or not the SelectedObject should currently have a white highlight around it. This method defaults to return true if IsCursorOnUi() is false.

    Declaration
    public override bool ShouldHighlightSelectedObject(object obj)
    Parameters
    Type Name Description
    System.Object obj

    The selected object, which can be a MapObject or a Wall.

    Returns
    Type Description
    System.Boolean

    Whether or not the selected object should be highlighted

    Overrides
    Tool.ShouldHighlightSelectedObject(Object)

    Update(GameTime)

    This method is called every update frame for the CurrentTool. By default, this method updates the MousePos and invokes OnUpdate, and also manages the UndoRedoStack.

    Declaration
    public override void Update(GameTime time)
    Parameters
    Type Name Description
    Microsoft.Xna.Framework.GameTime time

    The game's time

    Overrides
    Tool.Update(GameTime)

    Extension Methods

    Extensions.JsonCopy<T>(T)
    ☀
    ☾
    In This Article
    Back to top
    © 2021-2023 Ellpeck Games, Top Hat Studios – Impressum – Privacy – Status
    ☀
    ☾