예제 #1
0
        private void DrawOverlayScreen(bool isLevelCompleteScreen, float rating = 0)
        {
            BasicGraphics.SetColor4(0.0f, 0.0f, 0.0f, 0.85f);
            BasicGraphics.DrawSquare(new Vector2(-2, 2), new Vector2(2, -2));

            Texture headerTexture = isLevelCompleteScreen ? overlayGameComplete : overlayGamePaused;

            DrawTexture(headerTexture, new Vector2(-0.6f, 0.6f), new Vector2(0.6f, 0.36f));

            if (isLevelCompleteScreen)
            {
                DrawRatings(rating);
            }

            DrawTexture(overlayPressX, new Vector2(-0.6f, -0.4f), new Vector2(0.6f, -0.64f));
        }
예제 #2
0
        private void DrawCollectible(Collectible collectible, int stateValue)
        {
            float alpha      = Math.Max(stateValue / (float)collectibleMaximumValue, 0);
            float sizeFactor = 1 - alpha;

            BasicGraphics.SetColor4(1.0f, 0.9f, 0.4f, alpha);

            float x   = collectible.Position.X;
            float y   = collectible.Position.Y;
            float add = VisualValues.HalfCollectibleWidthHeight * sizeFactor * 1.5f;
            float h   = VisualValues.HalfCollectibleWidthHeight + add;

            Vector2 v1 = new Vector2(x - h, y + h);
            Vector2 v2 = new Vector2(x + h, y - h);

            DrawSquare(v1, v2);
        }