Interface IMotion
- Namespace
- TrinketTinker.Companions.Motions
- Assembly
- TrinketTinker.dll
public interface IMotion
Properties
BoundingBox
Anim sprite bounding box
Rectangle BoundingBox { get; }
Property Value
- Rectangle
CompanionAnimSprite
Current variant data
TinkerAnimSprite CompanionAnimSprite { get; }
Property Value
MotionClass
Type name of the motion, can use short form like "Hover" for hover motion.
string MotionClass { get; }
Property Value
NetRand
Random used for anim clips
Random NetRand { get; set; }
Property Value
Speaker
Current variant data
ChatterSpeaker Speaker { get; }
Property Value
Methods
Cleanup()
Cleanup motion, remove light source.
void Cleanup()
Draw(SpriteBatch)
Draws the companion, for all game instances in multiplayer.
void Draw(SpriteBatch b)
Parameters
bSpriteBatch
GetDrawLayer()
Get draw layer of motion
float GetDrawLayer()
Returns
- float
offset
GetOffset()
Get position offset of motion
Vector2 GetOffset()
Returns
- Vector2
offset
Initialize(Farmer)
Initialize motion, setup light source if needed.
void Initialize(Farmer farmer)
Parameters
farmerFarmer
IsFacing(Vector2)
Check is facing
bool IsFacing(Vector2 pos)
Parameters
posVector2
Returns
OnOwnerWarp()
Update light source when owner changes location
void OnOwnerWarp()
SetActiveAnchors(IEnumerable<string>)
Rebuild the list of active anchors.
void SetActiveAnchors(IEnumerable<string> strings)
Parameters
stringsIEnumerable<string>
SetAltVariant(string?, Trinket?)
Set an alt variant.
void SetAltVariant(string? altVariantKey, Trinket? trinketItem)
Parameters
altVariantKeystringtrinketItemTrinket
SetCurrAnchorTarget(int)
Sync curr anchor target value
void SetCurrAnchorTarget(int newValue)
Parameters
newValueint
SetMotionVariantData(MotionData, VariantData)
Update motion and variant data, when invalidate
void SetMotionVariantData(MotionData mdata, VariantData vdata)
Parameters
mdataMotionDatavdataVariantData
SetOneshotClip(string?)
Set an oneshot clip, to play once until end
void SetOneshotClip(string? clipKey)
Parameters
clipKeystring
SetOverrideClip(string?)
Set an override clip, to play instead of normal directional animation
void SetOverrideClip(string? clipKey)
Parameters
clipKeystring
SetSpeechBubble(string?)
Set a speech bubble to call, usually on ability proc.
void SetSpeechBubble(string? speechBubbleKey)
Parameters
speechBubbleKeystring
UpdateAnchor(GameTime, GameLocation)
Changes the position of the anchor that the companion moves relative to.
AnchorTarget UpdateAnchor(GameTime time, GameLocation location)
Parameters
timeGameTimelocationGameLocation
Returns
- AnchorTarget
post update anchor target
UpdateGlobal(GameTime, GameLocation)
Update info that should change every tick, for all game instances in multiplayer.
void UpdateGlobal(GameTime time, GameLocation location)
Parameters
timeGameTimelocationGameLocation
UpdateLightSource(GameTime, GameLocation)
Reposition the lightsource.
void UpdateLightSource(GameTime time, GameLocation location)
Parameters
timeGameTimelocationGameLocation
UpdateLocal(GameTime, GameLocation)
Update info that should change every tick, for owner only. Netfield changes should happen here.
void UpdateLocal(GameTime time, GameLocation location)
Parameters
timeGameTimelocationGameLocation