示例#1
0
 /// <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>();
 }
示例#2
0
 internal EntryDesc(EntryDesc _Desc) : this(_Desc.Font, _Desc.StartPosition, _Desc.EndPosition)
 {
     SelectedColor = _Desc.SelectedColor;
     Color         = _Desc.Color;
     FadeSpeed     = _Desc.FadeSpeed;
     GlowSpeed     = _Desc.GlowSpeed;
 }
示例#3
0
        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);
        }
示例#4
0
        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));
        }
示例#5
0
        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);
            }
        }
示例#6
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;
 }
示例#7
0
 internal AcceptBox(EntryDesc _Desc, Vector2 _Size) : base(ContentManager.Dot, _Desc, _Size)
 {
     AddEntry("Back", Close);
 }
示例#8
0
 internal void Set_Desc(EntryDesc _Desc)
 {
     Desc = new EntryDesc(_Desc);
 }