public TwoDAxis(VerticalAxis axis, bool x, bool right) : base((right ? "Right" : "Left") + (x ? "X" : "Y")) { mX = x; mWrappedAxis = axis; foreach (var source in mWrappedAxis.Sources) { source.OnPress += i => { mDown = true; mCurrentlyDown = source; }; source.OnRelease += i => { mDown = false; mCurrentlyDown = null; }; } if (!mX) { Deadzone.Changed += v => mWrappedAxis.Deadzone.Value = v; Scale.Changed += v => mWrappedAxis.Scale.Value = v; } else { Deadzone.Changed += v => mWrappedAxis.Change(); } }
internal VerticalAxis(params ITouchSource[] sources) : base("Single") { mSources = sources; foreach (var source in mSources) { source.OnPress += i => { mDown = true; mCurrentlyDown = source; }; source.OnRelease += i => { mDown = false; mCurrentlyDown = null; }; } Deadzone.Changed += d => Change(); }
internal VerticalAxis(params ITouchSource[] sources) : base("Single") { mSources = sources; foreach (var source in mSources) { source.OnPress += i => { mDown = true; mCurrentlyDown = source; }; source.OnRelease += i => { mDown = false; mCurrentlyDown = null; }; } Deadzone.Changed += d => Change(); }
public TwoDAxis(VerticalAxis axis, bool x, bool right) : base((right ? "Right" : "Left") + (x ? "X" : "Y")) { mX = x; mWrappedAxis = axis; foreach (var source in mWrappedAxis.Sources) { source.OnPress += i => { mDown = true; mCurrentlyDown = source; }; source.OnRelease += i => { mDown = false; mCurrentlyDown = null; }; } if (!mX) { Deadzone.Changed += v => mWrappedAxis.Deadzone.Value = v; Scale.Changed += v => mWrappedAxis.Scale.Value = v; } else Deadzone.Changed += v => mWrappedAxis.Change(); }