public override void Update(ref Matrix parentMatrix) { // Check for input but only if selected. if (selected) { GamePadInput pad = GamePadInput.GetGamePad0(); if (pad.ButtonA.WasPressed) { check = !check; if (check && onCheck != null) { onCheck(); } else if (!check && onClear != null) { onClear(); } pad.ButtonA.ClearAllWasPressedState(); Foley.PlayClick(); dirty = true; } } RefreshTexture(); base.Update(ref parentMatrix); } // end of UIGrid2DCheckboxElement Update()
public override void Update(ref Matrix parentMatrix) { // Check for input but only if selected. if (selected) { GamePadInput pad = GamePadInput.GetGamePad0(); // Handle input changes here. if (pad.DPadLeft.WasPressed || pad.DPadLeft.WasRepeatPressed || pad.LeftStickLeft.WasPressed || pad.LeftStickLeft.WasRepeatPressed) { if (DecrementCurrentValue()) { Foley.PlayClick(); } } if (pad.DPadRight.WasPressed || pad.DPadRight.WasRepeatPressed || pad.LeftStickRight.WasPressed || pad.LeftStickRight.WasRepeatPressed) { if (IncrementCurrentValue()) { Foley.PlayClick(); } } } RefreshTexture(); base.Update(ref parentMatrix); } // end of UIGridBaseSliderElement Update()
public void SetFocus(int indexNew) { float twitchTime = 0.1f; // Undo previous slice selection state. if ((this.indexLastHoverItem > -1) && (this.indexLastHoverItem != indexNew)) { PieMenuSlice menuSlice = this.slices[indexLastHoverItem]; menuSlice.DiffuseColor = PieSelector.RenderObjSlice.ColorNormal; if (slices.Count > 2) // dont move them if only two { ITransform transformSlice = menuSlice.mySlice as ITransform; TwitchManager.Set <Vector3> set = delegate(Vector3 value, Object param) { transformSlice.Local.OriginTranslation = value; transformSlice.Compose(); }; TwitchManager.CreateTwitch <Vector3>( transformSlice.Local.OriginTranslation, SliceOffsetDefault, set, twitchTime, TwitchCurve.Shape.EaseInOut); } } // apply new slice selection state // if (indexNew != indexCenteredItem) if ((indexNew > -1) && (indexNew != indexCurrentHoverItem)) { PieMenuSlice menuSlice = this.slices[indexNew]; menuSlice.DiffuseColor = PieSelector.RenderObjSlice.ColorSelectedBright; Foley.PlayClick(); if (slices.Count > 2) // don't move them if only two { ITransform transformSlice = menuSlice.mySlice as ITransform; { TwitchManager.Set <Vector3> set = delegate(Vector3 value, Object param) { transformSlice.Local.OriginTranslation = value; transformSlice.Compose(); }; TwitchManager.CreateTwitch <Vector3>( transformSlice.Local.OriginTranslation, new Vector3(0.20f, 0.0f, 0.0f), set, twitchTime, TwitchCurve.Shape.EaseInOut); } } indexCurrentHoverItem = indexNew; } }
public void NavCardNext() { if (this.indexActiveCard < listControls.Count - 1) { Foley.PlayClick(); NavCard(this.indexActiveCard + 1); } }
public void NavCardPrev() { if (this.indexActiveCard > 0) { Foley.PlayClick(); NavCard(this.indexActiveCard - 1); } }
} // end of UIGridTextListElement AddText() public override void Update(ref Matrix parentMatrix) { // Check for input but only if selected. if (selected && textList.Count > 1) { GamePadInput pad = GamePadInput.GetGamePad0(); bool changed = false; // Handle input changes here. if (pad.ButtonA.WasPressed || pad.ButtonA.WasRepeatPressed) { do { ++curIndex; if (curIndex >= textList.Count) { curIndex = 0; } Foley.PlayClick(); changed = true; } while (textList[curIndex].Hidden); } if (changed) { onChange(textList[curIndex].Text); dirty = true; //RecalcPositions(); } } RefreshTexture(); base.Update(ref parentMatrix); } // end of UIGridTextListElement Update()