public void renderMenu()
        {
            text.render();
            text2.render();
            text3.render();

            if (selectorState < 3)
            {
                selector.Position = new Point(floor(.5 * x), floor(18 * y + selectorState * y * 1.15));
            }
            else
            {
                selector.Position = new Point(7 * x, floor(18 * y + (selectorState - 3) * y * 1.15));
            }
            selector.render();

            switch (actualStateDraw)
            {
            case -1: break;

            case 0: text4.render(); break;

            case 1: text5.render(); break;

            default: text6.render(); break;
            }
            if (actualStateDraw >= 2)
            {
                if (infiniteStamina)
                {
                    seleccionado.Position = new Point(floor(7.2 * x), 18 * y);
                    seleccionado.render();
                }
                if (squeletonHalfSpeed)
                {
                    seleccionado.Position = new Point(floor(7.2 * x), 18 * y + floor(1.12 * y));
                    seleccionado.render();
                }
                if (inmunity)
                {
                    seleccionado.Position = new Point(floor(7.2 * x), 18 * y + floor(1.12 * y) * 4);
                    seleccionado.render();
                }
                if (debugVisualizations)
                {
                    seleccionado.Position = new Point(floor(7.2 * x), 18 * y + floor(1.12 * y) * 5);
                    seleccionado.render();
                }
                candlesRequiredText.Text = candlesRequired.ToString();
                candlesRequiredText.render();
                candlesInMapText.Text = candlesInMap.ToString();
                candlesInMapText.render();
                indieText.Text = pixelsBuf == 0 ? "no" : pixelsBuf.ToString();
                indieText.render();
            }
        }
Beispiel #2
0
        public void Render()
        {
            // Si derrota muestro el mensaje
            if (gameOverLose)
            {
                gameOverMsg.Text  = "YOU LOSE!";
                gameOverMsg.Color = Color.Red;
                gameOverMsg.render();
            }
            // Si victoria muestro el mensaje
            if (gameOverWin)
            {
                gameOverMsg.Text  = "YOU WIN!";
                gameOverMsg.Color = Color.Green;
                gameOverMsg.render();
            }
            // Si pausado muestro el mensaje
            if (paused)
            {
                pauseMsg.render();
            }

            // Renderiza todo lo perteneciente al mundo físico
            world.Render(gameModel);

            // Renderizar el HUD
            if (!endMatch)
            {
                hud.Render(gameModel);

                /* enemyHP.Text = world.enemy.hitPoints.ToString();
                 * var x = world.enemy.Mesh.Transform.Origin.X;
                 * var y = world.enemy.Mesh.Transform.Origin.Y;
                 * var z = world.enemy.Mesh.Transform.Origin.Z;
                 * enemyHP.Position = // usar matriz de proyeccion NO SE COMO ES
                 * enemyHP.render();*/
            }

            // Renderizar el Vector UP
            if (drawUpVector)
            {
                directionArrow.Render();
            }

            // Acción para volver al menu inicial
            if (toStartMenu)
            {
                gameModel.GameState = new MenuInicial(gameModel);
                this.Dispose();
            }
        }
Beispiel #3
0
 public override void Render()
 {
     PreRender();
     DrawText.drawText("Este ejemplo solo es el Client, debe tener primero levantando un server...", 5, 50, Color.DarkCyan);
     text.render();
     PostRender();
 }
        public void Render()
        {
            if (isExit)
            {
                gameModel.Exit();
                return;
            }

            // Iniciar dibujado de sprites
            drawer2D.BeginDrawSprite();

            // Dibujar sprites
            drawer2D.DrawSprite(background);
            if (showStart)
            {
                drawer2D.DrawSprite(start);
            }

            // Finalizar el dibujado de Sprites
            drawer2D.EndDrawSprite();

            if (showMenu)
            {
                play.render();
                controls.render();
                exit.render();
            }

            if (isNextState)
            {
                gameModel.GameState = new SelectorVehiculo(gameModel);
                this.Dispose();
            }
        }
Beispiel #5
0
        public override void Render(float elapsedTime)
        {
            GuiMessage msg = gui.Update(elapsedTime, Input);

            switch (msg.message)
            {
            case MessageType.WM_COMMAND:

                switch (msg.id)
                {
                case ID_CRAFT_SHIP_HELM:
                    CraftShipHelm();
                    break;
                }

                break;
            }

            gui.Render();
            text.render();

            if (showNoElemMsg && msgTime < 5)
            {
                msgTime += elapsedTime;
                noelementsMsg.render();
            }

            if (showCraftElemMsg && msgTime < 5)
            {
                msgTime += elapsedTime;
                craftElementMsg.render();
            }
        }
Beispiel #6
0
        public override void Render()
        {
            PreRender();

            //Ver si cambio el WAV
            var filePath = wavFileModifier.Value;

            loadSound(filePath);

            //Contro el input de teclado
            if (Input.keyPressed(Key.Y))
            {
                var playLoop = playLoopModifier.Value;
                sound.play(playLoop);
            }
            else if (Input.keyPressed(Key.O))
            {
                sound.stop();
            }

            //Render texto
            currentSoundText.render();
            instruccionesText.render();

            PostRender();
        }
        public override void Render()
        {
            PreRender();

            //Ver si cambio el WAV
            var filePath = (string)Modifiers["WAV-File"];

            loadSound(filePath);

            //Contro el input de teclado
            if (Input.keyPressed(Key.Y))
            {
                var playLoop = (bool)Modifiers["PlayLoop"];
                sound.play(playLoop);
            }
            else if (Input.keyPressed(Key.O))
            {
                sound.stop();
            }

            //Render texto
            currentSoundText.render();
            instruccionesText.render();

            PostRender();
        }
Beispiel #8
0
        public override void Render()
        {
            //BackgroundColor
            D3DDevice.Instance.Device.Clear(ClearFlags.Target | ClearFlags.ZBuffer, Color.Black, 1.0f, 0);
            BeginScene();
            ClearTextures();

            //Cargar variables shader
            mesh.Effect.SetValue("ambientColor", ColorValue.FromColor(Color.Gray));
            mesh.Effect.SetValue("diffuseColor", ColorValue.FromColor(Color.LightBlue));
            mesh.Effect.SetValue("specularColor", ColorValue.FromColor(Color.White));
            mesh.Effect.SetValue("specularExp", 10f);
            mesh.Effect.SetValue("lightPosition", lightPos);
            mesh.Effect.SetValue("eyePosition", TGCVector3.Vector3ToFloat4Array(Camara.Position));

            mesh.RotateY(-ElapsedTime / 2);
            mesh.Transform = TGCMatrix.Scaling(mesh.Scale)
                             * TGCMatrix.RotationYawPitchRoll(mesh.Rotation.Y, mesh.Rotation.X, mesh.Rotation.Z)
                             * TGCMatrix.Translation(mesh.Position);
            mesh.Render();

            textHelp.render();

            //Help
            if (Input.keyPressed(Key.H))
            {
                helpForm.ShowDialog();
            }

            PostRender();
        }
Beispiel #9
0
 public override void Render()
 {
     PreRender();
     DrawText.drawText("Este ejemplo solo es el Server, debe conectar clientes, una vez conectado un cliente espere uno instantes para ver los mensajes.", 5, 50, Color.DarkCyan);
     text.render();
     PostRender();
 }
Beispiel #10
0
        public void Render()
        {
            selected.SampleMesh.Render();

            background.RenderAll();

            drawer2D.BeginDrawSprite();

            drawer2D.DrawSprite(flechaIzq);
            drawer2D.DrawSprite(flechaDer);
            drawer2D.DrawSprite(flechaArriba);

            drawer2D.EndDrawSprite();

            select.render();
            vehicleName.render();

            if (confirmed)
            {
                gameModel.GameState = new Partida(gameModel, selected);
                this.Dispose();
            }
            else if (back)
            {
                gameModel.GameState = new MenuInicial(gameModel);
                this.Dispose();
            }
        }
Beispiel #11
0
        public void Render()
        {
            if (!env.modoDios)
            {
                //Iniciar dibujado de todos los Sprites del HUD
                drawer2D.BeginDrawSprite();


                //Dibujar sprite (si hubiese mas, deberian ir todos aquí)
                drawer2D.DrawSprite(backgroundHUD);
                drawer2D.DrawSprite(personaje);
                drawer2D.DrawSprite(hacha);
                drawer2D.DrawSprite(comida);
                drawer2D.DrawSprite(vaso);
                drawer2D.DrawSprite(inventario0);
                drawer2D.DrawSprite(inventario1);
                drawer2D.DrawSprite(inventario2);
                drawer2D.DrawSprite(inventario3);

                //Finalizar el dibujado de Sprites
                drawer2D.EndDrawSprite();

                // Renderizo los puntos de vida
                txtCansancio.render();
                txtSed.render();
                txtHambre.render();

                inventario0text.render();
                inventario1text.render();
                inventario2text.render();
                inventario3text.render();
            }
        }
Beispiel #12
0
        public override void Render()
        {
            //BackgroundColor
            D3DDevice.Instance.Device.Clear(ClearFlags.Target | ClearFlags.ZBuffer, Color.Black, 1.0f, 0);
            D3DDevice.Instance.Device.BeginScene();
            ClearTextures();

            //Cargar variables shader
            mesh.Effect.SetValue("ambientColor", ColorValue.FromColor(Color.Gray));
            mesh.Effect.SetValue("diffuseColor", ColorValue.FromColor(Color.LightBlue));
            mesh.Effect.SetValue("specularColor", ColorValue.FromColor(Color.White));
            mesh.Effect.SetValue("specularExp", 10f);
            mesh.Effect.SetValue("lightPosition", lightPos);
            mesh.Effect.SetValue("eyePosition",
                                 TgcParserUtils.vector3ToFloat4Array(Camara.Position));

            mesh.rotateY(-ElapsedTime / 2);
            mesh.render();

            textHelp.render();

            //Help
            if (Input.keyPressed(Key.H))
            {
                helpForm.ShowDialog();
            }

            PostRender();
        }
Beispiel #13
0
 public void TiempoFinal(float contador)
 {
     TiempoF.Text = "" + contador + " Segundos";
     TiempoF.render();
     TiempoFF.Text = "" + contador + " Segundos";
     TiempoFF.render();
 }
 public void Render(GameModel contexto)
 {
     if (contexto.escenarioActual is EscenarioMenu)
     {
         texto.render();
     }
     quad.Render();
     AABB.Render();
 }
Beispiel #15
0
        public override void Render()
        {
            PreRender();

            //Ver si cambio el MP3
            var filePath = (string)Modifiers["MP3-File"];

            loadMp3(filePath);

            //Contro del reproductor por teclado
            var currentState = mp3Player.getStatus();

            if (Input.keyPressed(Key.Y))
            {
                if (currentState == TgcMp3Player.States.Open)
                {
                    //Reproducir MP3
                    mp3Player.play(true);
                }
                if (currentState == TgcMp3Player.States.Stopped)
                {
                    //Parar y reproducir MP3
                    mp3Player.closeFile();
                    mp3Player.play(true);
                }
            }
            else if (Input.keyPressed(Key.U))
            {
                if (currentState == TgcMp3Player.States.Playing)
                {
                    //Pausar el MP3
                    mp3Player.pause();
                }
            }
            else if (Input.keyPressed(Key.I))
            {
                if (currentState == TgcMp3Player.States.Paused)
                {
                    //Resumir la ejecución del MP3
                    mp3Player.resume();
                }
            }
            else if (Input.keyPressed(Key.O))
            {
                if (currentState == TgcMp3Player.States.Playing)
                {
                    //Parar el MP3
                    mp3Player.stop();
                }
            }

            //Render texto
            currentMusicText.render();
            instruccionesText.render();

            PostRender();
        }
Beispiel #16
0
 private void renderFloatingVegetation()
 {
     if (Mesh != null)
     {
         Mesh.Render();
         Mesh.BoundingBox.Render();
         label.render();
     }
 }
        public override void Render(float elapsedTime)
        {
            drawer2D.BeginDrawSprite();
            drawer2D.DrawSprite(backgroundSprite);
            drawer2D.EndDrawSprite();

            text.render();

            GuiMessage msg = gui.Update(elapsedTime, Input);

            // proceso el msg
            switch (msg.message)
            {
            case MessageType.WM_COMMAND:
                switch (msg.id)
                {
                case IDOK:
                    if (msg_box_app_exit)
                    {
                        Application.Exit();
                    }
                    if (msg_box_nueva_mision)
                    {
                        music.closeFile();
                        GameModel.ChangeLevel();
                    }
                    break;

                case IDCANCEL:
                    gui.EndDialog();
                    break;

                case ID_NUEVA_PARTIDA:
                    gui.MessageBox("Nueva Partida", "TGC Gui Demo");
                    msg_box_nueva_mision = true;
                    msg_box_app_exit     = false;
                    break;

                case ID_APP_EXIT:
                    gui.MessageBox("Desea Salir?", "TGC Gui Demo");
                    msg_box_app_exit     = true;
                    msg_box_nueva_mision = false;
                    break;

                case ID_CONTROLES:
                    gui.MessageBoxControles("Controles", "TGC Gui Demo");
                    break;
                }
                break;

            default:
                break;
            }

            gui.Render();
        }
Beispiel #18
0
        public override void Render()
        {
            PreRender();

            //Render texto
            currentSoundText.render();
            instruccionesText.render();

            PostRender();
        }
Beispiel #19
0
        public override void Render()
        {
            PreRender();

            //Renderizar los tres textoss
            text1.render();
            text2.render();
            text3.render();

            PostRender();
        }
Beispiel #20
0
 public void render(float elapseElapsedTime)
 {
     text2d          = new TgcText2D();
     text2d.Text     = this.GenerarMinutosYSegundos(elapseElapsedTime);
     text2d.Color    = Color.WhiteSmoke;
     text2d.Align    = TgcText2D.TextAlign.LEFT;
     text2d.Position = new Point(D3DDevice.Instance.Width - 150, 0);
     text2d.Size     = new Size(300, 100);
     text2d.changeFont(new Font("TimesNewRoman", 25, FontStyle.Bold));
     text2d.Color = Color.Yellow;
     text2d.render();
 }
Beispiel #21
0
        public void Render(GameModel gameModel)
        {
            // Mini Viewport
            device.Viewport = view;

            var posOriginal = mesh.Position;
            var cam         = (TgcThirdPersonCamera)gameModel.Camara;

            time += gameModel.ElapsedTime;
            var asd = gameModel.Camara.LookAt - gameModel.Camara.Position;

            asd.Normalize();
            asd *= 4.85f;

            if (player1.SelectedWeapon != null)
            {
                mesh.Position = gameModel.Camara.Position + asd;
                mesh.Rotation = new TGCVector3(0, cam.RotationY, 0);
                mesh.RotateY(FastMath.Cos(time * 3) * 1.3f);
                mesh.Render();
            }

            device.Viewport = original_view;

            // Dibujar los Sprites
            drawer2D.BeginDrawSprite();
            drawer2D.DrawSprite(hudSprites);
            drawer2D.DrawSprite(healthBar);
            drawer2D.DrawSprite(specialBar);
            drawer2D.EndDrawSprite();

            // Renderizar Texto
            if (speed.Text.Contains("-"))
            {
                speed.Color = Color.IndianRed;
            }
            else
            {
                speed.Color = Color.Green;
            }

            speed.render();
            km.render();
            weaponName.render();
            ammoQuantity.render();
            reloj.render();

            if (player1.turbo)
            {
                turbo.render();
            }
        }
Beispiel #22
0
 public void Render()
 {
     drawer2D.BeginDrawSprite();
     sprites.ForEach(s => drawer2D.DrawSprite(s));
     if (GameModel.modoGod)
     {
         drawer2D.DrawSprite(GOD);
     }
     drawer2D.EndDrawSprite();
     soles.Text = "" + GameLogic.cantidadEnergia;
     soles.render();
     zombies.Text = "" + GameLogic.cantidadZombiesMuertos;
     zombies.render();
 }
Beispiel #23
0
        public void Render()
        {
            if (estaVivo)
            {
                modeloNave.AplicarTransformaciones();
                modeloNave.Render();
            }
            else
            {
                textoGameOver.render();
            }

            new TgcText2D().drawText("Velocidad de la nave:\n" + velocidadActual.ToString(), 5, 20, Color.White);
            new TgcText2D().drawText("Posicion de la nave:\n" + posicion.ToString(), 5, 60, Color.White);
            new TgcText2D().drawText("Rotacion de la nave:\n" + rotacionActual.ToString(), 5, 130, Color.White);
        }
Beispiel #24
0
        public override void Render()
        {
            if (gameInstance.FocusInGame || gameInstance.InPrincipalMenu)   // Solo renderizar si estoy en pausa
            {
                return;
            }
            base.Render();
            Drawer2D drawer = new Drawer2D();

            drawer.BeginDrawSprite();

            drawer.DrawSprite(background);

            drawer.EndDrawSprite();
            pauseText.render();
        }
Beispiel #25
0
        public void render()
        {
            //Muestra la vida solo del auto principal
            if (this.auto_principal)
            {
                //text2d = new TgcText2D();
                text2d.Text     = "Balas: " + nBalas.ToString() + "";
                text2d.Color    = Color.WhiteSmoke;
                text2d.Align    = TgcText2D.TextAlign.LEFT;
                text2d.Position = new Point((D3DDevice.Instance.Width / 3) - 100, 0);
                text2d.Size     = new Size(300, 100);
                text2d.changeFont(new Font("TimesNewRoman", 25, FontStyle.Bold));
                text2d.Color = Color.Yellow;

                if (this.nBalas < 10)
                {
                    text2d.Color = Color.OrangeRed;
                }
                if (this.nBalas < 5)
                {
                    text2d.Color = Color.Red;
                }

                text2d.render();

                //text2d2 = new TgcText2D();
                text2d2.Text     = "Misiles: " + nMisiles.ToString() + "";
                text2d2.Color    = Color.WhiteSmoke;
                text2d2.Align    = TgcText2D.TextAlign.LEFT;
                text2d2.Position = new Point((D3DDevice.Instance.Width / 6) - 100, 0);
                text2d2.Size     = new Size(300, 100);
                text2d2.changeFont(new Font("TimesNewRoman", 25, FontStyle.Bold));
                text2d2.Color = Color.Yellow;
                if (this.nMisiles < 10)
                {
                    text2d2.Color = Color.OrangeRed;
                }
                if (this.nMisiles < 5)
                {
                    text2d2.Color = Color.Red;
                }

                text2d2.render();
            }
        }
Beispiel #26
0
        public void RenderGUI(float elapsedTime)
        {
            GuiMessage msg = gui.Update(elapsedTime, Input);

            switch (msg.message)
            {
            case MessageType.WM_COMMAND:

                switch (msg.id)
                {
                case 1:
                    active = false;
                    PlayerModel.ShowInventory  = false;
                    PlayerModel.ShowFatherNote = true;
                    break;

                case 2:
                    if (PlayerModel.CanUseShipHelm)
                    {
                        active = false;
                        PlayerModel.ShowInventory = false;
                        ShowShipHelm    = false;
                        RenderShipHelm  = true;
                        PlayerModel.Win = true;
                    }
                    else
                    {
                        showNoUseShipHelmMsg = true;
                        msgTime = 0;
                    }
                    break;
                }

                break;
            }

            gui.Render();
            text.render();

            if (showNoUseShipHelmMsg && msgTime < 3)
            {
                msgTime += elapsedTime;
                noUseShipHelmText.render();
            }
        }
        private void RenderHUD()
        {
            principalMenu.Render();
            if (InPrincipalMenu)
            {
                return;
            }
            healthTextBox.render();
            oxygenTextBox.render();
            pauseMenu.Render();

            if (showCrosshair)
            {
                crossHair.render();
            }

            gameTimer.render();
        }
        public override void Render()
        {
            if (!gameInstance.InPrincipalMenu)   // Solo renderizar si estoy en pausa
            {
                return;
            }
            base.Render();
            Drawer2D drawer = new Drawer2D();

            drawer.BeginDrawSprite();

            drawer.DrawSprite(background);
            drawer.DrawSprite(wasdSprite);
            drawer.DrawSprite(escISprite);
            drawer.DrawSprite(mouseSprite);

            drawer.EndDrawSprite();
            titleText.render();
        }
Beispiel #29
0
        public override void Render()
        {
            PreRender();

            if (Input.keyPressed(Key.V))
            {
                ShowVegetation ^= true;
            }

            if (Input.keyPressed(Key.P))
            {
                planePicking ^= true;
            }

            if (Input.keyPressed(Key.F))
            {
                FpsModeEnable ^= true;
            }

            if (Input.keyPressed(Key.B))
            {
                RenderBoundingBoxes ^= true;
            }

            if (FpsModeEnable)
            {
                labelFPS.render();
            }

            if (!ShowVegetation)
            {
                labelVegetationHidden.render();
            }

            Terrain.Technique = "PositionColoredTextured";

            Brush.update(this);

            Brush.render(this);

            PostRender();
        }
        /// <summary>
        ///     Se llama cada vez que hay que refrescar la pantalla.
        ///     Escribir aquí todo el código referido al renderizado.
        ///     Borrar todo lo que no haga falta.
        /// </summary>
        public override void Render()
        {
            //Inicio el render de la escena, para ejemplos simples. Cuando tenemos postprocesado o shaders es mejor realizar las operaciones según nuestra conveniencia.
            PreRender();
            //habilito efecto de partículas
            D3DDevice.Instance.ParticlesEnabled = true;
            D3DDevice.Instance.EnableParticles();

            TopRightText.render();
            CenterText.render();
            MyWorld.render();
            MenuInterface.render();

            MyCamera.render();

            if (null != pickedObject)
            {
                //un objeto fue objetivo de una acción
                soundPlayer.playMaterialSound(pickedObject.material);

                if (!pickedObject.alive)
                {
                    //el objeto debe ser eliminado
                    if (pickedObject.objectType == InteractiveObject.ObjectTypes.Tree)
                    {
                        soundPlayer.playActionSound(SoundPlayer.Actions.TreeFall);
                    }
                }
            }

            //veo si emitir partículas
            if (emit)
            {
                emitter.render(emittedTime);
            }

            //Finaliza el render y presenta en pantalla, al igual que el preRender se debe para casos puntuales es mejor utilizar a mano las operaciones de EndScene y PresentScene
            PostRender();
        }