void input_FrameAdded(Frame rame, EventArgs args) { if (mConfig.Frame == null || rame.Name.Equals(mConfig.Frame)) { mFrame = rame; List <ITouchSource> sources = new List <ITouchSource>(); sources.Add(this); if (mOverlayPlugin != null) { sources.Add(new OverlayTouchSource(mOverlayPlugin[rame.Name])); } mL = new VerticalAxis(sources.ToArray()); mR = new VerticalAxis(sources.ToArray()); mLeftX = new TwoDAxis(mL, true, false); mLeftY = new TwoDAxis(mL, false, false); mRightX = new TwoDAxis(mR, true, true); mRightY = new TwoDAxis(mR, false, true); mSingle = new VerticalAxis(sources.ToArray()); mL.W = mConfig.LeftW; mL.H = mConfig.LeftH; mL.PaddingH = mConfig.LeftPaddingH; mL.PaddingV = mConfig.LeftPaddingV; mR.W = mConfig.RightW; mR.H = mConfig.RightH; mR.PaddingH = mConfig.RightPaddingH; mR.PaddingV = mConfig.RightPaddingV; mSingle.W = mConfig.SingleW; mSingle.H = mConfig.SingleH; mSingle.PaddingH = mConfig.SinglePaddingH; mSingle.PaddingV = mConfig.SinglePaddingV; mSinglePos = mConfig.SinglePos; mL.SizeChanged += OnChange; mR.SizeChanged += OnChange; mSingle.SizeChanged += OnChange; OnChange(); AddAxis(mLeftX); AddAxis(mLeftY); AddAxis(mRightX); AddAxis(mRightY); AddAxis(mSingle); Core input = rame.Core; if (Enabled) { Enabled = true; } } }
protected override void InitConfig() { LeftW = Get("Left", "W", .35f, "The width of the left control circle."); LeftH = Get("Left", "H", .8f, "The height of the left control circle."); LeftPaddingH = Get("Left", "PaddingH", .05f, "The padding to the left of the left control circle."); LeftPaddingV = Get("Left", "PaddingV", .1f, "The padding above the left control circle."); RightW = Get("Right", "W", .35f, "The width of the right control circle."); RightH = Get("Right", "H", .8f, "The height of the right control circle."); RightPaddingH = Get("Right", "PaddingH", .05f, "The padding to the left of the right control circle."); RightPaddingV = Get("Right", "PaddingV", .1f, "The padding above the right control circle."); SingleW = Get("Single", "W", .15f, "The width of the single axis control section."); SingleH = Get("Single", "H", .8f, "The height of the single axis control section."); SinglePaddingH = Get("Single", "PaddingH", .05f, "The padding to the left of the single axis control section."); SinglePaddingV = Get("Single", "PaddingV", .1f, "The padding above the single axis control section."); Frame = GetStr("Window", null, "The window which is a touch screen."); Opacity = Get("Opacity", .01f, "How opaque the input window should be."); //SinglePos = (SinglePos) Enum.Parse(typeof(SinglePos), Get("Single", "Position", "Right", "Where the single axis is positioned (Left, Right or Centre).")); SinglePos = GetEnum <SinglePos>("Single", "Position", SinglePos.Right, "Where the single axis is positioned (Left, Right or Centre).", LogManager.GetLogger("Touchscreen")); }
protected override void InitConfig() { LeftW = Get("Left", "W", .35f, "The width of the left control circle."); LeftH = Get("Left", "H", .8f, "The height of the left control circle."); LeftPaddingH = Get("Left", "PaddingH", .05f, "The padding to the left of the left control circle."); LeftPaddingV = Get("Left", "PaddingV", .1f, "The padding above the left control circle."); RightW = Get("Right", "W", .35f, "The width of the right control circle."); RightH = Get("Right", "H", .8f, "The height of the right control circle."); RightPaddingH = Get("Right", "PaddingH", .05f, "The padding to the left of the right control circle."); RightPaddingV = Get("Right", "PaddingV", .1f, "The padding above the right control circle."); SingleW = Get("Single", "W", .15f, "The width of the single axis control section."); SingleH = Get("Single", "H", .8f, "The height of the single axis control section."); SinglePaddingH = Get("Single", "PaddingH", .05f, "The padding to the left of the single axis control section."); SinglePaddingV = Get("Single", "PaddingV", .1f, "The padding above the single axis control section."); Frame = GetStr("Window", null, "The window which is a touch screen."); Opacity = Get("Opacity", .01f, "How opaque the input window should be."); //SinglePos = (SinglePos) Enum.Parse(typeof(SinglePos), Get("Single", "Position", "Right", "Where the single axis is positioned (Left, Right or Centre).")); SinglePos = GetEnum<SinglePos>("Single", "Position", SinglePos.Right, "Where the single axis is positioned (Left, Right or Centre).", LogManager.GetLogger("Touchscreen")); }
void input_FrameAdded(Frame rame, EventArgs args) { if (mConfig.Frame == null || rame.Name.Equals(mConfig.Frame)) { mFrame = rame; List<ITouchSource> sources = new List<ITouchSource>(); sources.Add(this); if (mOverlayPlugin != null) sources.Add(new OverlayTouchSource(mOverlayPlugin[rame.Name])); mL = new VerticalAxis(sources.ToArray()); mR = new VerticalAxis(sources.ToArray()); mLeftX = new TwoDAxis(mL, true, false); mLeftY = new TwoDAxis(mL, false, false); mRightX = new TwoDAxis(mR, true, true); mRightY = new TwoDAxis(mR, false, true); mSingle = new VerticalAxis(sources.ToArray()); mL.W = mConfig.LeftW; mL.H = mConfig.LeftH; mL.PaddingH = mConfig.LeftPaddingH; mL.PaddingV = mConfig.LeftPaddingV; mR.W = mConfig.RightW; mR.H = mConfig.RightH; mR.PaddingH = mConfig.RightPaddingH; mR.PaddingV = mConfig.RightPaddingV; mSingle.W = mConfig.SingleW; mSingle.H = mConfig.SingleH; mSingle.PaddingH = mConfig.SinglePaddingH; mSingle.PaddingV = mConfig.SinglePaddingV; mSinglePos = mConfig.SinglePos; mL.SizeChanged += OnChange; mR.SizeChanged += OnChange; mSingle.SizeChanged += OnChange; OnChange(); AddAxis(mLeftX); AddAxis(mLeftY); AddAxis(mRightX); AddAxis(mRightY); AddAxis(mSingle); Core input = rame.Core; if (Enabled) Enabled = true; } }