/// <summary> /// Returns the top left of the specified Frame Animation to allow for the center of the image to be vertically centered with the text, but with some pixels between the right of the image and the left of the text. /// If the Frame Animation specified is null, then the Idle or Enter frame will be used based on the UseIdleAnimation and UseEnteranimation flags. /// </summary> private Vector2 GetMenuSelectorPosition(MenuConstants.MenuOption menuOption, Frame2DAnimation menuSelectorFrameAnimation = null) { var frame = (menuSelectorFrameAnimation == null) ? this.menuSelectorFrameAnimation.Animation.CurrentFrame : menuSelectorFrameAnimation.CurrentFrame; var menuTextPosition = GetMenuTextPosition(menuOption); return new Vector2(menuTextPosition.X - frame.Width - 25, menuTextPosition.Y + (MenuConstants.MenuItemFont.LineSpacing / 2) - frame.Height / 2); }
/// <summary> Top-Left of the Menu Text Entry. </summary> private Vector2 GetMenuTextPosition(MenuConstants.MenuOption menuOption) { return new Vector2(MenuConstants.MenuStartX, MenuConstants.MenuStartY + (MenuConstants.MenuItemFont.LineSpacing * (int)menuOption)); }
/// <summary> Returns the top left of the Enter Animation to allow for the center of the image to be vertically centered with the Selector's arm cannon, as well as the top left of where it should end. </summary> private Vector2[] GetMenuSelectorEnterPositions(MenuConstants.MenuOption menuOption) { var menuSelectorPosition = GetMenuSelectorPosition(menuOption); var menuSelectorEnterPositionStart = new Vector2(menuSelectorPosition.X + this.menuSelectorFrameAnimation.Animation.CurrentFrame.Width - 8, menuSelectorPosition.Y); // It ends all the way beyond the screen boundaries var menuSelectorEnterPositionEnd = new Vector2(SharedResources.GameWindow.ClientBounds.Width, menuSelectorEnterPositionStart.Y); return new Vector2[] { menuSelectorEnterPositionStart, menuSelectorEnterPositionEnd }; }