Esempio n. 1
0
        private void drawNumber(SpriteBatch spriteBatch, CricketSegment segment, Vector2 numberPosition)
        {
            var numberOffset = _numberTextureSize*0.5f;
            Texture2D numberTexture;
            var segmentColor = Color.White;

            if (!segment.IsOpen)
            {
                segmentColor *= 0.33f;
            }

            if (segment.Segment == 25)
            {
                numberTexture = _bullTexture;
            }
            else
            {
                numberTexture = _numberTextures[segment.Segment - 15];
            }

            spriteBatch.Draw(numberTexture, numberPosition - numberOffset, segmentColor);

            if (!segment.IsOpen)
            {
                var closedTextureOffset = _closedTextureSize*0.5f;
                spriteBatch.Draw(_closedTexture, numberPosition - closedTextureOffset, Color.White);
            }
        }
Esempio n. 2
0
        private void drawMark(SpriteBatch spriteBatch, CricketSegment segment, Player player, Vector2 position,
            float scaling)
        {
            var marks = segment.GetScoredMarks(player);
            var segmentColor = Color.White;

            if (marks > 0)
            {
                if (!segment.IsOpen)
                {
                    segmentColor *= 0.33f;
                }

                spriteBatch.Draw(_markTexture[Math.Min(marks, 3)], position, null, segmentColor, 0,
                    _markTextureSize*0.5f, scaling, SpriteEffects.None, 0);
            }
        }