示例#1
0
        private void ShowSplashScreen()
        {
            // Do nothing when we're on DEBUG builds.
            // The splash is just annoying.
#if !DEBUG
            const uint SIZE_X = 600;
            const uint SIZE_Y = 300;
            // Size of the NT logo in the bottom left.
            const float  NT_SIZE_X = SIZE_X / 10f;
            const float  NT_SIZE_Y = SIZE_Y / 10f;
            CluwneWindow window    = CluwneLib.ShowSplashScreen(new VideoMode(SIZE_X, SIZE_Y));

            var logoTexture = new Texture(_resourceManager.ContentFileRead(@"Textures/Logo/logo.png"));
            var logo        = new SFML.Graphics.Sprite(logoTexture);
            var logoSize    = logoTexture.Size;
            logo.Position = new Vector2f(SIZE_X / 2 - logoSize.X / 2, SIZE_Y / 2 - logoSize.Y / 2);

            var backgroundTexture = new Texture(_resourceManager.ContentFileRead(@"Textures/Logo/background.png"));
            var background        = new SFML.Graphics.Sprite(backgroundTexture);
            var backgroundSize    = backgroundTexture.Size;
            background.Scale = new Vector2f((float)SIZE_X / backgroundSize.X, (float)SIZE_Y / backgroundSize.Y);

            var nanotrasenTexture = new Texture(_resourceManager.ContentFileRead(@"Textures/Logo/nanotrasen.png"));
            var nanotrasen        = new SFML.Graphics.Sprite(nanotrasenTexture);
            var nanotrasenSize    = nanotrasenTexture.Size;
            nanotrasen.Scale    = new Vector2f(NT_SIZE_X / nanotrasenSize.X, NT_SIZE_Y / nanotrasenSize.Y);
            nanotrasen.Position = new Vector2f(SIZE_X - NT_SIZE_X - 5, SIZE_Y - NT_SIZE_Y - 5);
            nanotrasen.Color    = new Color(255, 255, 255, 64);

            window.Draw(background);
            window.Draw(logo);
            window.Draw(nanotrasen);
            window.Display();
#endif
        }
        private void ShowSplashScreen()
        {
            // Do nothing when we're on DEBUG builds.
            // The splash is just annoying.
#if !DEBUG
            const uint SIZE_X = 600;
            const uint SIZE_Y = 300;
            // Size of the NT logo in the bottom right.
            const float  NT_SIZE_X = SIZE_X / 10f;
            const float  NT_SIZE_Y = SIZE_Y / 10f;
            CluwneWindow window    = CluwneLib.ShowSplashScreen(new VideoMode(SIZE_X, SIZE_Y));

            var logo = _resourceCache.GetSprite("ss14_logo");
            logo.Position = new Vector2f(SIZE_X / 2 - logo.TextureRect.Width / 2, SIZE_Y / 2 - logo.TextureRect.Height / 2);

            var background = _resourceCache.GetSprite("ss14_logo_background");
            background.Scale = new Vector2f((float)SIZE_X / background.TextureRect.Width, (float)SIZE_Y / background.TextureRect.Height);

            var nanotrasen = _resourceCache.GetSprite("ss14_logo_nt");
            nanotrasen.Scale    = new Vector2f(NT_SIZE_X / nanotrasen.TextureRect.Width, NT_SIZE_Y / nanotrasen.TextureRect.Height);
            nanotrasen.Position = new Vector2f(SIZE_X - NT_SIZE_X - 5, SIZE_Y - NT_SIZE_Y - 5);
            nanotrasen.Color    = new Color(255, 255, 255, 64);

            window.Draw(background);
            window.Draw(logo);
            window.Draw(nanotrasen);
            window.Display();
#endif
        }
示例#3
0
        private void ShowSplashScreen()
        {
            // Do nothing when we're on DEBUG builds.
            // The splash is just annoying.
#if !DEBUG
            const uint SIZE_X = 600;
            const uint SIZE_Y = 300;
            // Size of the NT logo in the bottom left.
            const float  NT_SIZE_X = SIZE_X / 10f;
            const float  NT_SIZE_Y = SIZE_Y / 10f;
            CluwneWindow window    = CluwneLib.ShowSplashScreen(new VideoMode(SIZE_X, SIZE_Y));

            var assembly = Assembly.GetExecutingAssembly();

            var logoTexture = new Texture(assembly.GetManifestResourceStream("SS14.Client._EmbeddedBaseResources.Logo.logo.png"));
            var logo        = new SFML.Graphics.Sprite(logoTexture);
            var logoSize    = logoTexture.Size;
            logo.Position = new Vector2f(SIZE_X / 2 - logoSize.X / 2, SIZE_Y / 2 - logoSize.Y / 2);

            var backgroundTexture = new Texture(assembly.GetManifestResourceStream("SS14.Client._EmbeddedBaseResources.Logo.background.png"));
            var background        = new SFML.Graphics.Sprite(backgroundTexture);
            var backgroundSize    = backgroundTexture.Size;
            background.Scale = new Vector2f((float)SIZE_X / backgroundSize.X, (float)SIZE_Y / backgroundSize.Y);

            var nanotrasenTexture = new Texture(assembly.GetManifestResourceStream("SS14.Client._EmbeddedBaseResources.Logo.nanotrasen.png"));
            var nanotrasen        = new SFML.Graphics.Sprite(nanotrasenTexture);
            var nanotrasenSize    = nanotrasenTexture.Size;
            nanotrasen.Scale    = new Vector2f(NT_SIZE_X / nanotrasenSize.X, NT_SIZE_Y / nanotrasenSize.Y);
            nanotrasen.Position = new Vector2f(SIZE_X - NT_SIZE_X - 5, SIZE_Y - NT_SIZE_Y - 5);
            nanotrasen.Color    = new Color(255, 255, 255, 64);

            window.Draw(background);
            window.Draw(logo);
            window.Draw(nanotrasen);
            window.Display();
#endif
        }