示例#1
0
        public void ChangeRes(int resX, int resY, bool rotateScreen, bool applyChanges)
        {
            // initialize rotation
            CDrawable.Init(feel, resX, resY, rotateScreen);

            if ((screenResX == resX && screenResY == resY && drawRotated == rotateScreen) ||
                (screenResY == resX && screenResX == resY && drawRotated != rotateScreen))
            {
            }
            else
            {
                _resolutionChanged = true;
                if (applyChanges)
                {
                    if (rotateScreen)
                    {
                        graphics.PreferredBackBufferHeight = resX;
                        graphics.PreferredBackBufferWidth  = resY;
                    }
                    else
                    {
                        graphics.PreferredBackBufferWidth  = resX;
                        graphics.PreferredBackBufferHeight = resY;
                    }
                    graphics.ApplyChanges();
                }
            }

            drawRotated      = rotateScreen;
            screenResX       = resX;
            screenResY       = resY;
            ratioX           = (float)screenResX / 640;
            ratioY           = (float)screenResY / 480;
            _screenRectangle = new Rectangle(0, 0, drawRotated ? screenResY : screenResX, drawRotated ? screenResX : screenResY);
        }
示例#2
0
 public void AddItem(CDrawable item)
 {
     if (item == null)
     {
         return;
     }
     item.Parent = (CDrawable)this;
     _items.Add(item);
 }
示例#3
0
 public virtual void SetFocus()
 {
     focusedDrawable = this;
 }