Esempio n. 1
0
        public void draw(SpriteBatchWrapper sprites, GraphicsDevice device)
        {
            sprites.fillWithColor(Color.Black, 1.0f);

            if (null == this.player || MediaState.Stopped == this.player.State)
                return;

            Texture2D videoTexture = player.GetTexture();
            if (null != videoTexture) {
                if (0 == this.size.Width)
                    this.size = sprites.calcMaxProportionalSize(videoTexture);

                sprites.drawFromCenter(videoTexture, this.size.Width, this.size.Height);
            }
        }
        public void draw(SpriteBatchWrapper sprites, GraphicsDevice device)
        {
            if (null != backgroundColor)
                sprites.fillWithColor(backgroundColor, 1.0f);
            if (!targetSizeIsValid()) {
                this.targetSize = sprites.calcMaxProportionalSize(this.picture);
            }

            sprites.drawFromCenter(
                this.picture,
                this.targetSize.Width,
                this.targetSize.Height,
                0, 0,
                Color.White * this.fadeAmount);
        }