Interface IMotion
- Namespace
- TrinketTinker.Companions.Motions
- Assembly
- TrinketTinker.dll
public interface IMotion
Properties
BoundingBox
Anim sprite bounding box
Rectangle BoundingBox { get; }
Property Value
- Rectangle
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
b
SpriteBatch
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
farmer
Farmer
IsFacing(Vector2)
Check is facing
bool IsFacing(Vector2 pos)
Parameters
pos
Vector2
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
strings
IEnumerable<string>
SetAltVariant(string?)
Set an alt variant.
void SetAltVariant(string? altVariantKey)
Parameters
altVariantKey
string
SetCurrAnchorTarget(int)
Sync curr anchor target value
void SetCurrAnchorTarget(int newValue)
Parameters
newValue
int
SetMotionVariantData(MotionData, VariantData)
Update motion and variant data, when invalidate
void SetMotionVariantData(MotionData mdata, VariantData vdata)
Parameters
mdata
MotionDatavdata
VariantData
SetOneshotClip(string?)
Set an oneshot clip, to play once until end
void SetOneshotClip(string? clipKey)
Parameters
clipKey
string
SetOverrideClip(string?)
Set an override clip, to play instead of normal directional animation
void SetOverrideClip(string? clipKey)
Parameters
clipKey
string
SetSpeechBubble(string?)
Set a speech bubble to call, usually on ability proc.
void SetSpeechBubble(string? speechBubbleKey)
Parameters
speechBubbleKey
string
UpdateAnchor(GameTime, GameLocation)
Changes the position of the anchor that the companion moves relative to.
AnchorTarget UpdateAnchor(GameTime time, GameLocation location)
Parameters
time
GameTimelocation
GameLocation
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
time
GameTimelocation
GameLocation
UpdateLightSource(GameTime, GameLocation)
Reposition the lightsource.
void UpdateLightSource(GameTime time, GameLocation location)
Parameters
time
GameTimelocation
GameLocation
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
time
GameTimelocation
GameLocation