Example #1
0
 /// <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();
 }
Example #2
0
 public ScreenComp(RenderTarget2D renderTarget)
 {
     SpriteBatch = new TTSpriteBatch(TTGame.Instance.GraphicsDevice);
     this.renderTarget = renderTarget;
     InitScreenDimensions();
 }
Example #3
0
 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);
 }