Ejemplo n.º 1
0
 public void OpenDepthStream()
 {
     DepthStream = new DepthStreamRenderer(Game as NeatGame);
 }
Ejemplo n.º 2
0
        //-------------------------------------------

        public LearnAndPlayGame()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            //----------------------------------------//
            //           PIERWSZY EKRAN               //
            //----------------------------------------//
            if (Settings.PROJECT_STATE == Settings.Environment.DEVELOPMENT)
            {
                activeScreen = Settings.STARTING_SCREEN;
            }
            else
            {
                activeScreen = GameType.LoadingScreen;
            }
            //----------------------------------------//

            //Kursor widoczny na ekranie
            pointer = new Pointer();

            //Czcionki dostepne w aplikacji
            fonts = new Fonts();

            //InfoBox wyswietlany w trakcie gry
            infoBox = new InfoBox(fonts);
            infoBox.Disable();
            infoBox.Invisible();

            //Sledzony szkielet
            trackedSkeleton = new TrackedSkeleton();

            //Chmura
            cloud = new Cloud.Services();

            //----------------------------------------------------------------------------------------------------------------------
            //                                                  USTAWIENIA OKNA
            //----------------------------------------------------------------------------------------------------------------------
            //Ustawienie nazwy okna
            this.Window.Title = "Ucz siê i baw z Kinectem!";

            this.graphics.PreferredBackBufferWidth       = Settings.WINDOW_WIDTH;
            this.graphics.PreferredBackBufferHeight      = Settings.WINDOW_HEIGHT;
            this.graphics.PreparingDeviceSettings       += this.GraphicsDevicePreparingDeviceSettings;
            this.graphics.SynchronizeWithVerticalRetrace = true;

            //----------------------------------------------------------------------------------------------------------------------
            //                                       INICJALIZACJA KINECTA I USTAWIENIA
            //----------------------------------------------------------------------------------------------------------------------
            this.viewPortRectangle = new Rectangle((int)infoBox.getPosition().X, (int)infoBox.getPosition().Y, 130, 130);

            // Sensor bedzie uzywal rozdzielczosci 640x480 dla obu strumieni
            this.chooser = new KinectChooser(this, ColorImageFormat.RgbResolution640x480Fps30, DepthImageFormat.Resolution640x480Fps30);
            this.Services.AddService(typeof(KinectChooser), this.chooser);

            // ColorStream - pozycja i rozmiar
            this.colorStream          = new ColorStreamRenderer(this);
            this.colorStream.Size     = new Vector2(this.viewPortRectangle.Width, this.viewPortRectangle.Height);
            this.colorStream.Position = new Vector2(infoBox.getPosition().X + 160, infoBox.getPosition().Y + 10);

            // DepthStream - pozycja i rozmiar
            this.depthStream          = new DepthStreamRenderer(this);
            this.depthStream.Size     = new Vector2(this.viewPortRectangle.Width, this.viewPortRectangle.Height);
            this.depthStream.Position = new Vector2(infoBox.getPosition().X + 150, infoBox.getPosition().Y);

            this.Components.Add(this.chooser);

            //Licznik klatek
            if (Settings.PROJECT_STATE == Settings.Environment.DEVELOPMENT)
            {
                this.Components.Add(new FrameRateCounter(this));
            }

            speech = new KinectSpeech(chooser.Sensor);
            //----------------------------------------------------------------------------------------------------------------------
        }