MeatMotion

MotionBuilderExtensions

Add struct-state bindings and configure integer rounding, string scrambling, and punch or shake oscillation.

Namespace
MeatMotion
Assembly
MeatMotion

Jump to members

public static partial class MotionBuilderExtensions
StringMotion.cs · L50

Members

WithRichText

Choose whether string interpolation accounts for rich-text tags.

public static MotionBuilder<TValue, StringOptions, TAdapter> WithRichText<TValue, TAdapter>( this MotionBuilder<TValue, StringOptions, TAdapter> builder, bool richTextEnabled = true)
    where TValue : unmanaged
    where TAdapter : unmanaged, IMotionAdapter<TValue, StringOptions>
Parameters and return value
builder
this MotionBuilder<TValue, StringOptions, TAdapter> Configured builder, passed as the receiver for extension calls.
richTextEnabled = true
bool Whether interpolation accounts for rich-text markup.
Returns
MotionBuilder<TValue, StringOptions, TAdapter>

WithScrambleChars

Set the character set or custom characters used to scramble unrevealed text.

public static MotionBuilder<TValue, StringOptions, TAdapter> WithScrambleChars<TValue, TAdapter>( this MotionBuilder<TValue, StringOptions, TAdapter> builder, ScrambleMode scrambleMode)
    where TValue : unmanaged
    where TAdapter : unmanaged, IMotionAdapter<TValue, StringOptions>
Parameters and return value
builder
this MotionBuilder<TValue, StringOptions, TAdapter> Configured builder, passed as the receiver for extension calls.
scrambleMode
ScrambleMode Character set used to fill unrevealed text.
Returns
MotionBuilder<TValue, StringOptions, TAdapter>
public static MotionBuilder<TValue, StringOptions, TAdapter> WithScrambleChars<TValue, TAdapter>( this MotionBuilder<TValue, StringOptions, TAdapter> builder, FixedString64Bytes customScrambleChars)
    where TValue : unmanaged
    where TAdapter : unmanaged, IMotionAdapter<TValue, StringOptions>
Parameters and return value
builder
this MotionBuilder<TValue, StringOptions, TAdapter> Configured builder, passed as the receiver for extension calls.
customScrambleChars
FixedString64Bytes Character set used to fill unrevealed text.
Returns
MotionBuilder<TValue, StringOptions, TAdapter>

WithRandomSeed

Set the random seed for scrambling or shake.

public static MotionBuilder<TValue, StringOptions, TAdapter> WithRandomSeed<TValue, TAdapter>( this MotionBuilder<TValue, StringOptions, TAdapter> builder, uint seed)
    where TValue : unmanaged
    where TAdapter : unmanaged, IMotionAdapter<TValue, StringOptions>
Parameters and return value
builder
this MotionBuilder<TValue, StringOptions, TAdapter> Configured builder, passed as the receiver for extension calls.
seed
uint Pseudorandom seed.
Returns
MotionBuilder<TValue, StringOptions, TAdapter>
public static MotionBuilder<TValue, ShakeOptions, TAdapter> WithRandomSeed<TValue, TAdapter>( this MotionBuilder<TValue, ShakeOptions, TAdapter> builder, uint seed)
    where TValue : unmanaged
    where TAdapter : unmanaged, IMotionAdapter<TValue, ShakeOptions>
Parameters and return value
builder
this MotionBuilder<TValue, ShakeOptions, TAdapter> Configured builder, passed as the receiver for extension calls.
seed
uint Pseudorandom seed.
Returns
MotionBuilder<TValue, ShakeOptions, TAdapter>

WithFrequency

Set the oscillation frequency for punch or shake.

public static MotionBuilder<TValue, PunchOptions, TAdapter> WithFrequency<TValue, TAdapter>( this MotionBuilder<TValue, PunchOptions, TAdapter> builder, int frequency)
    where TValue : unmanaged
    where TAdapter : unmanaged, IMotionAdapter<TValue, PunchOptions>
Parameters and return value
builder
this MotionBuilder<TValue, PunchOptions, TAdapter> Configured builder, passed as the receiver for extension calls.
frequency
int Oscillation frequency setting.
Returns
MotionBuilder<TValue, PunchOptions, TAdapter>
public static MotionBuilder<TValue, ShakeOptions, TAdapter> WithFrequency<TValue, TAdapter>( this MotionBuilder<TValue, ShakeOptions, TAdapter> builder, int frequency)
    where TValue : unmanaged
    where TAdapter : unmanaged, IMotionAdapter<TValue, ShakeOptions>
Parameters and return value
builder
this MotionBuilder<TValue, ShakeOptions, TAdapter> Configured builder, passed as the receiver for extension calls.
frequency
int Oscillation frequency setting.
Returns
MotionBuilder<TValue, ShakeOptions, TAdapter>

WithDampingRatio

Set how the punch or shake amplitude decays over time.

public static MotionBuilder<TValue, PunchOptions, TAdapter> WithDampingRatio<TValue, TAdapter>( this MotionBuilder<TValue, PunchOptions, TAdapter> builder, float dampingRatio)
    where TValue : unmanaged
    where TAdapter : unmanaged, IMotionAdapter<TValue, PunchOptions>
Parameters and return value
builder
this MotionBuilder<TValue, PunchOptions, TAdapter> Configured builder, passed as the receiver for extension calls.
dampingRatio
float Damping applied to oscillation.
Returns
MotionBuilder<TValue, PunchOptions, TAdapter>
public static MotionBuilder<TValue, ShakeOptions, TAdapter> WithDampingRatio<TValue, TAdapter>( this MotionBuilder<TValue, ShakeOptions, TAdapter> builder, float dampingRatio)
    where TValue : unmanaged
    where TAdapter : unmanaged, IMotionAdapter<TValue, ShakeOptions>
Parameters and return value
builder
this MotionBuilder<TValue, ShakeOptions, TAdapter> Configured builder, passed as the receiver for extension calls.
dampingRatio
float Damping applied to oscillation.
Returns
MotionBuilder<TValue, ShakeOptions, TAdapter>

WithShakeMode

Choose between random and Perlin shake.

public static MotionBuilder<TValue, ShakeOptions, TAdapter> WithShakeMode<TValue, TAdapter>( this MotionBuilder<TValue, ShakeOptions, TAdapter> builder, ShakeMode shakeMode)
    where TValue : unmanaged
    where TAdapter : unmanaged, IMotionAdapter<TValue, ShakeOptions>
Parameters and return value
builder
this MotionBuilder<TValue, ShakeOptions, TAdapter> Configured builder, passed as the receiver for extension calls.
shakeMode
ShakeMode Noise mode used to evaluate the shake.
Returns
MotionBuilder<TValue, ShakeOptions, TAdapter>

Bind

Pass struct state to the setter, after the interpolated value.

public static MotionHandle Bind<TState>(this FloatMotionBuilder builder, TState state, Action<float, TState> action)
    where TState : struct
Parameters and return value
builder
this FloatMotionBuilder Configured builder, passed as the receiver for extension calls.
state
TState State passed to the setter after the interpolated value.
action
Action<float, TState> Callback receiving the sampled value.
Returns
MotionHandle
public static MotionHandle Bind<TValue, TOptions, TAdapter, TState>( this MotionBuilder<TValue, TOptions, TAdapter> builder, TState state, Action<TValue, TState> action)
    where TValue : unmanaged
    where TOptions : unmanaged, IMotionOptions
    where TAdapter : unmanaged, IMotionAdapter<TValue, TOptions>
    where TState : struct
Parameters and return value
builder
this MotionBuilder<TValue, TOptions, TAdapter> Configured builder, passed as the receiver for extension calls.
state
TState State passed to the setter after the interpolated value.
action
Action<TValue, TState> Callback receiving the sampled value.
Returns
MotionHandle

WithRoundingMode

Choose how an interpolated int or long is rounded.

public static MotionBuilder<TValue, IntegerOptions, TAdapter> WithRoundingMode<TValue, TAdapter>( this MotionBuilder<TValue, IntegerOptions, TAdapter> builder, RoundingMode roundingMode)
    where TValue : unmanaged
    where TAdapter : unmanaged, IMotionAdapter<TValue, IntegerOptions>
Parameters and return value
builder
this MotionBuilder<TValue, IntegerOptions, TAdapter> Configured builder, passed as the receiver for extension calls.
roundingMode
RoundingMode Rounding rule for integer interpolation.
Returns
MotionBuilder<TValue, IntegerOptions, TAdapter>

Related types