/// <summary>create a ScreenComp of given dimensions with optionally a RenderTarget. /// If (0,0) given, uses default backbuffer size </summary> public ScreenComp(bool hasRenderBuffer, int x = 0, int y = 0) { SpriteBatch = new TTSpriteBatch(TTGame.Instance.GraphicsDevice); if (hasRenderBuffer) { if (x == 0 && y == 0) { x = TTGame.Instance.GraphicsDevice.PresentationParameters.BackBufferWidth; y = TTGame.Instance.GraphicsDevice.PresentationParameters.BackBufferHeight; } renderTarget = new RenderTarget2D(TTGame.Instance.GraphicsDevice, x, y); } InitScreenDimensions(); }
public ScreenComp(RenderTarget2D renderTarget) { SpriteBatch = new TTSpriteBatch(TTGame.Instance.GraphicsDevice); this.renderTarget = renderTarget; InitScreenDimensions(); }
protected void OnConstruction() { // TODO spritebatch can be supplied from outside? optimize TTGame.Instance.GraphicsDevice access? SpriteBatch = new TTSpriteBatch(TTGame.Instance.GraphicsDevice); }
public GameInfoBox() : base() { InitComponents(); MySpriteBatch = new TTSpriteBatch(Screen.graphicsDevice); }