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
        }
Exemple #2
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
        }
Exemple #3
0
        public static void Initialize()
        {
            if (IsInitialized)
            {
                Terminate();
            }

            Time = new GameTiming();

            var video = Video;
            var wind  = new RenderWindow(video.GetVideoMode(), "Developer Station 14", video.GetWindowStyle());

            Window = new CluwneWindow(wind, video);
            Window.Graphics.SetVerticalSyncEnabled(true);
            Window.Graphics.SetFramerateLimit(300);

            renderTargetArray = new RenderTarget[5];
            //Window.Viewport = new Viewport(0, 0, 800, 600);
            IsInitialized = true;

            //Hook OpenTK into SFMLs Opengl
            OpenTK.Toolkit.Init(new OpenTK.ToolkitOptions
            {
                // Non-Native backend doesn't have a default GetAddress method
                Backend = OpenTK.PlatformBackend.PreferNative
            });
            new GraphicsContext(OpenTK.ContextHandle.Zero, null);
        }
Exemple #4
0
        public static void Initialize()
        {
            if (IsInitialized)
            {
                Terminate();
            }

            Time = new GameTiming();

            Screen = new CluwneWindow(CluwneLib.Video.getVideoMode(), "Developer Station 14", CluwneLib.Video.getWindowStyle());
            Screen.SetVerticalSyncEnabled(true);
            Screen.SetFramerateLimit(300);

            renderTargetArray       = new RenderTarget[5];
            CurrentClippingViewport = new Viewport(0, 0, Screen.Size.X, Screen.Size.Y);
            IsInitialized           = true;

            //Hook OpenTK into SFMLs Opengl
            OpenTK.Toolkit.Init(new OpenTK.ToolkitOptions
            {
                // Non-Native backend doesn't have a default GetAddress method
                Backend = OpenTK.PlatformBackend.PreferNative
            });
            new GraphicsContext(OpenTK.ContextHandle.Zero, null);
        }
        public static CluwneWindow ShowSplashScreen(VideoMode vMode)
        {
            if (SplashScreen == null)
            {
                SplashScreen = new CluwneWindow(vMode, "Space Station 14", Styles.None);
            }

            return(SplashScreen);
        }
Exemple #6
0
        public static CluwneWindow ShowSplashScreen(VideoMode vMode)
        {
            if (SplashScreen != null)
            {
                return(SplashScreen);
            }

            var video = new VideoSettings(vMode);

            return(SplashScreen = new CluwneWindow(new RenderWindow(vMode, "Space Station 14", Styles.None), video));
        }
Exemple #7
0
        public static void SetMode(int width, int height, bool fullscreen, bool p4, bool p5, int refreshRate)
        {
            Styles stylesTemp = new Styles();

            if (fullscreen)
            {
                stylesTemp = Styles.Fullscreen;
            }
            else
            {
                stylesTemp = Styles.Default;
            }

            Screen = new CluwneWindow(new VideoMode((uint)width, (uint)height), "Space Station 14", stylesTemp);
        }
Exemple #8
0
        public static void Initialize()
        {
            if (IsInitialized)
            {
                Terminate();
            }

            Time = new GameTiming();

            var video = Video;
            var wind  = new RenderWindow(video.GetVideoMode().SFMLVideoMode, "Developer Station 14", video.GetWindowStyle());

            Window = new CluwneWindow(wind, video);
            Window.Graphics.SetVerticalSyncEnabled(true);

            renderTargetArray = new IRenderTarget[5];
            IsInitialized     = true;
        }
Exemple #9
0
        public InputEvents(CluwneWindow window)
        {
            // if dummy don't attach events
            if (window == null)
            {
                return;
            }

            SFML.Graphics.RenderWindow SWindow = window.SFMLWindow;

            SWindow.KeyPressed          += (sender, args) => KeyPressed?.Invoke(sender, (KeyEventArgs)args);
            SWindow.KeyReleased         += (sender, args) => KeyReleased?.Invoke(sender, (KeyEventArgs)args);
            SWindow.MouseButtonPressed  += (sender, args) => MouseButtonPressed?.Invoke(sender, (MouseButtonEventArgs)args);
            SWindow.MouseButtonReleased += (sender, args) => MouseButtonReleased?.Invoke(sender, (MouseButtonEventArgs)args);
            SWindow.MouseMoved          += (sender, args) => MouseMoved?.Invoke(sender, (MouseMoveEventArgs)args);
            SWindow.MouseWheelScrolled  += (sender, args) => MouseWheelMoved?.Invoke(sender, (MouseWheelScrollEventArgs)args);
            SWindow.MouseEntered        += (sender, args) => MouseEntered?.Invoke(sender, args);
            SWindow.MouseLeft           += (sender, args) => MouseLeft?.Invoke(sender, args);
            SWindow.TextEntered         += (sender, args) => TextEntered?.Invoke(sender, (TextEventArgs)args);
        }
Exemple #10
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
        }
Exemple #11
0
 public static void SetMode(int displayWidth, int displayHeight)
 {
     Screen = new CluwneWindow(new VideoMode((uint)displayWidth, (uint)displayHeight), "Space station 14");
 }