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); }
public void AddItem(CDrawable item) { if (item == null) { return; } item.Parent = (CDrawable)this; _items.Add(item); }
public virtual void SetFocus() { focusedDrawable = this; }