This class represents a type of modded tree. The tree will share a tile ID with the vanilla trees (5), so that the trees can freely convert between each other if the soil below is converted. This class encapsulates several functions that distinguish each type of tree from each other.
More...
|
| virtual bool | CanDropAcorn () |
| | Whether or not this tree can drop acorns. Returns true by default. More...
|
| |
| virtual int | CreateDust () |
| | Return the type of dust created when this tree is destroyed. Returns 7 by default. More...
|
| |
| abstract int | DropWood () |
| | The ID of the item that is dropped in bulk when this tree is destroyed. More...
|
| |
|
abstract Asset< Texture2D > | GetBranchTextures () |
| | Return the texture containing the possible tree branches that can be drawn next to this tree. The framing was determined under <cref>SetTreeFoliageSettings</cref>
|
| |
| abstract Asset< Texture2D > | GetTexture () |
| |
|
abstract Asset< Texture2D > | GetTopTextures () |
| | Return the texture containing the possible tree tops that can be drawn above this tree. The framing was determined under <cref>SetTreeFoliageSettings</cref>
|
| |
| virtual int | SaplingGrowthType (ref int style) |
| | Defines the sapling that can eventually grow into a tree. The type of the sapling should be returned here. Returns 20 and style 0 by default. The style parameter will determine which sapling is chosen if multiple sapling types share the same ID; even if you only have a single sapling in an ID, you must still set this to 0. More...
|
| |
| abstract void | SetStaticDefaults () |
| |
|
virtual void | SetTreeFoliageSettings (int i, int j, Tile tile, int xoffset, ref int treeFrame, int floorY, ref int topTextureFrameWidth, ref int topTextureFrameHeight) |
| | Allows customization of various tree foliage drawing parameters. These control how leafy branches and the tree top are drawn at the i and j coordinates.
treeFrame indicates which option for tree top or branch will be drawn. Hallow trees use this to provide many more options (various colors) than the default 3 options by adjusting based on i .
floorY is the y tile coordinate of the tile this tree is grown on.
topTextureFrameWidth and topTextureFrameHeight dictate the size of the sprite for the tree top. The tree top will be drawn centered above the top tile of the tree. These default to 80 and should be consistent between each tree top option. Branches are 40x40 and are not customizable.
xoffset will be 0 for tree tops, 1 for a left branch, and -1 for a right branch. Can be combined with i and floorY to calculate the coordinates of the tile this tree is grown on.
|
| |
|
virtual void | SetTreeFoliageSettings (Tile tile, ref int xoffset, ref int treeFrame, ref int floorY, ref int topTextureFrameWidth, ref int topTextureFrameHeight) |
| |
| virtual bool | Shake (int x, int y, ref bool createLeaves) |
| | Executed on tree shake, return false to skip vanilla tree shake drops.
The x and y coordinates correspond to the top of the tree, where items usually spawn. More...
|
| |
| virtual int | TreeLeaf () |
| | Return the type of gore created when the tree grow, being shook and falling leaves on windy days, returns -1 by default More...
|
| |
| bool | Shake (int x, int y, ref bool createLeaves) |
| |
| int | TreeLeaf () |
| |
|
abstract Asset< Texture2D > | GetTexture () |
| |
| void ILoadable. | Load (Mod mod) |
| | Called when loading the type. More...
|
| |
|
abstract void | SetStaticDefaults () |
| |
| void ILoadable. | Unload () |
| | Called during unloading when needed. More...
|
| |
| virtual bool | IsLoadingEnabled (Mod mod) |
| | Whether or not this type should be loaded when it's told to. Returning false disables Mod.AddContent from actually loading this type. More...
|
| |
| abstract void | Load (Mod mod) |
| | Called when loading the type. More...
|
| |
| abstract void | Unload () |
| | Called during unloading when needed. More...
|
| |
This class represents a type of modded tree. The tree will share a tile ID with the vanilla trees (5), so that the trees can freely convert between each other if the soil below is converted. This class encapsulates several functions that distinguish each type of tree from each other.