/// <summary> /// If you do not send a description as parameter you MUST use Set_Desc! /// </summary> /// <param name="_Desc"></param> internal MenuScene(EntryDesc _Desc = null) : base(false) { mTransitionOnTime = 0.5f; mTransitionOffTime = 0.5f; Desc = (_Desc == null) ? null : new EntryDesc(_Desc); mEntries = new List <MenuEntry>(); }
internal EntryDesc(EntryDesc _Desc) : this(_Desc.Font, _Desc.StartPosition, _Desc.EndPosition) { SelectedColor = _Desc.SelectedColor; Color = _Desc.Color; FadeSpeed = _Desc.FadeSpeed; GlowSpeed = _Desc.GlowSpeed; }
internal MainMenuScene() : base() { EntryDesc menuDesc = new EntryDesc(ContentManager.Font, new Vector2(SceneManager.Width / 2, SceneManager.Height), new Vector2(SceneManager.Width / 2, SceneManager.Height / 2)); menuDesc.Color = Color.Coral; menuDesc.SelectedColor = Color.LightBlue; Set_Desc(menuDesc); AddEntry("Start", Start); AddEntry("Level Editor", Edit); AddEntry("Exit", Close); }
internal MenuEntry(string _Text, EntryDesc _Desc, Action _Action = null) { mText = _Text; mDesc = new EntryDesc(_Desc); BoundAction = _Action; mPosition = mDesc.StartPosition; mScale = 1.0f; mRotation = 0.0f; mLayerDepth = 1.0f; Vector2 size = mDesc.Font.MeasureString(mText) * mScale; mOrigin = size / 2.0f; mBounds = new Rectangle((int)(mPosition.X - mOrigin.X), (int)(mPosition.Y - mOrigin.Y), (int)(size.X), (int)(size.Y)); }
internal void AddEntry(string _Text, Action _Action = null) { if (Desc == null) { throw new Exception("No description specified!"); } EntryDesc desc = new EntryDesc(Desc); desc.StartPosition += new Vector2(0.0f, Desc.Font.LineSpacing * mEntries.Count); desc.EndPosition += new Vector2(0.0f, Desc.Font.LineSpacing * mEntries.Count); mEntries.Add(new MenuEntry(_Text, desc, _Action)); if (mEntries.Count == 1) { Set_SelectedIndex(0); } }
internal MessageBox(Texture2D _Texture, EntryDesc _Desc, Vector2 _Size) : base(_Desc) { mBounds = new Rectangle((int)(_Desc.StartPosition.X - _Size.X / 2), (int)(_Desc.StartPosition.Y - _Size.Y / 2), (int)_Size.X, (int)_Size.Y); mTexture = _Texture; }
internal AcceptBox(EntryDesc _Desc, Vector2 _Size) : base(ContentManager.Dot, _Desc, _Size) { AddEntry("Back", Close); }
internal void Set_Desc(EntryDesc _Desc) { Desc = new EntryDesc(_Desc); }