コード例 #1
0
ファイル: UIManager.cs プロジェクト: Racura/AtlasEngine
        public UIManager(AtlasGlobal atlas)
            : base(atlas)
        {
            View = new UIView(atlas, new RectangleF(0, 0, 640, 480));

            Atlas.Graphics.onResolutionChange += () =>
            {
                View.Frame = new RectangleF(0, 0, Atlas.Graphics.ResolutionWidth, Atlas.Graphics.ResolutionHeight);
            };
        }
コード例 #2
0
ファイル: UIView.cs プロジェクト: Racura/AtlasEngine
        public void AddSubviews(UIView view)
        {
            if (view.SuperViews != null)
                throw new Exception("Element can't have multiple Views");

            if (_subviews == null)
                _subviews = new List<UIView>();

            _subviews.Add(view);
            view.SuperViews = this;

            SubViews = _subviews.ToArray();
        }