Class BodyPart
Representation of a bodypart for a pose-style character
Constructors
BodyPart(BodyPart, bool, bool, int, int)
Representation of a bodypart for a pose-style character
Declaration
public BodyPart(BodyPart parent, bool useLimbFlip, bool rotateWithBody, int defaultPivotX, int defaultPivotY)
Parameters
Type | Name | Description |
---|---|---|
BodyPart | parent | Which bodypart does this bodypart attached on. Set to null if it's not a limb |
bool | useLimbFlip | True if the limb flip horizontaly when rotate over specified angle |
bool | rotateWithBody | True if the limb apply rotation from body of the character |
Fields
Covered
How this bodypart is being covered by cloths
Declaration
public BodyPart.CoverMode Covered
FrontSide
True if the bodypart is facing front
Declaration
public bool FrontSide
GlobalX
Position X in global space
Declaration
public int GlobalX
GlobalY
Position Y in global space
Declaration
public int GlobalY
Height
Vertical size of this bodypart
Declaration
public int Height
PivotX
Current pivot X of this bodypart (0 means left, 1000 means right)
Declaration
public int PivotX
PivotY
Current pivot Y of this bodypart (0 means bottom, 1000 means top)
Declaration
public int PivotY
Rotation
Angle of this bodypart
Declaration
public int Rotation
Tint
Color tint
Declaration
public Color32 Tint
Width
Horizontal size of this bodypart
Declaration
public int Width
X
Position X in local space
Declaration
public int X
Y
Position Y in local space
Declaration
public int Y
Z
Z value for sort rendering cells
Declaration
public int Z
Properties
Border
Artwork sprite border
Declaration
public Int4 Border { get; }
FacingRight
True if this bodypart is facing right
Declaration
public bool FacingRight { get; }
FacingSign
Return 1 if this bodypart is facing right
Declaration
public int FacingSign { get; }
FlexableSizeY
Height that changes with character's body height
Declaration
public int FlexableSizeY { get; set; }
ID
Global unique id for this bodypart
Declaration
public int ID { get; }
IsFullCovered
True if this bodypart is totaly covered by cloth
Declaration
public bool IsFullCovered { get; }
LimbParent
Which bodypart does this bodypart attached on. Set to null if it's not a limb
Declaration
public BodyPart LimbParent { get; init; }
RotateWithBody
True if the limb apply rotation from body of the character
Declaration
public bool RotateWithBody { get; init; }
SizeX
Artwork sprite Width in global size
Declaration
public int SizeX { get; }
SizeY
Artwork sprite Height in global size
Declaration
public int SizeY { get; }
SpritePivotX
Artwork sprite pivot X
Declaration
public int SpritePivotX { get; }
SpritePivotY
Artwork sprite pivot Y
Declaration
public int SpritePivotY { get; }
UseLimbFlip
True if the limb flip horizontaly when rotate over specified angle
Declaration
public bool UseLimbFlip { get; init; }
Methods
GetGlobalCenter()
Get current center position in global space
Declaration
public Int2 GetGlobalCenter()
GetGlobalRect()
Get current position rect in global space
Declaration
public IRect GetGlobalRect()
GetLocalCenter()
Get current center position in local space
Declaration
public Int2 GetLocalCenter()
GlobalLerp(float, float, bool)
Get global position that lerp from given value
Declaration
public Int2 GlobalLerp(float x01, float y01, bool natural = false)
Parameters
Type | Name | Description |
---|---|---|
float | x01 | X lerp value (0 means left, 1 means right) |
float | y01 | Y lerp value (0 means bottom, 1 means top) |
bool | natural | True if this lerping logic respect character's natural orientation (like Tokino Sora's hairpin should always on her left side) |
Imitate(BodyPart)
Copy motion data from another bodypart without changing anything about data about source sprite
Declaration
public void Imitate(BodyPart other)
LimbRotate(int, int)
Rotate the bodypart with "LimbRotate" logic
Declaration
public void LimbRotate(int rotation, int grow = 1000)
How much does the limb grow it's size from the rotation (0 means don't grow. 1000 means general amount)
SetData(int)
Set bodypart data by giving a sprite ID
Declaration
public void SetData(int id)
TryGetSpriteIdFromSheet(Type, string, bool, out int)
Get sprite id to rendering bodypart for given type of character
Declaration
public static bool TryGetSpriteIdFromSheet(Type characterType, string bodyPartName, bool checkForGroup, out int id)
Parameters
Type | Name | Description |
---|---|---|
Type | characterType | Target type of character |
string | bodyPartName | Basic name of this bodypart |
bool | checkForGroup | True if the sprite can be get from sprite group |
int | id | Global ID of the result bodypart |
Returns
Type | Description |
---|---|
bool | True if the id is found |