private void DibujarTiempo() { string Tiempo = ""; //Calculo el tiempo Tiempo = (this.TiempoFin - DateTime.Now).Minutes.ToString().PadLeft(2, '0') + ":" + (this.TiempoFin - DateTime.Now).Seconds.ToString().PadLeft(2, '0'); if (this.finReloj || GameModel.finReloj) { TgcDrawText letraGanador = new TgcDrawText(D3DDevice.Instance.Device, "Rock it", 36, MediaDir); letraGanador.drawText("FIN DEL JUEGO", (Convert.ToInt32(D3DDevice.Instance.Width) / 2) - 200, (Convert.ToInt32(D3DDevice.Instance.Height) / 2) - 150, Color.Red); if (GameModel.nroGanador == 0) { letraGanador.drawText("GANASTE!!!", (Convert.ToInt32(D3DDevice.Instance.Width) / 2) - 200, (Convert.ToInt32(D3DDevice.Instance.Height) / 2), Color.Green); } else { letraGanador.drawText("PERDISTE...", (Convert.ToInt32(D3DDevice.Instance.Width) / 2) - 200, (Convert.ToInt32(D3DDevice.Instance.Height) / 2), Color.Red); } this.letraJugadores.drawText("00:00", Convert.ToInt32(D3DDevice.Instance.Width) - HUDJugador.POSICION_X_BARRA_VIDA + 35, HUDJugador.POSICION_Y_BARRA_VIDA - 40, Color.OrangeRed); this.letraJugadores.drawText("Presione la letra X para volver al menú inicial...", (Convert.ToInt32(D3DDevice.Instance.Width) / 2) - 200, (Convert.ToInt32(D3DDevice.Instance.Height) / 2) + 150, Color.OrangeRed); } else { this.letraJugadores.drawText(Tiempo, Convert.ToInt32(D3DDevice.Instance.Width) - HUDJugador.POSICION_X_BARRA_VIDA + 35, HUDJugador.POSICION_Y_BARRA_VIDA - 40, Color.OrangeRed); } }
public HUDJugador(string MediaDirectory, string NombreJugador, int MultiplicadorPos) { //Guardo variables this.MediaDir = MediaDirectory; this.NombreJugador = NombreJugador; this.MultiplicadorPos = MultiplicadorPos; //Creo el dibujador de las barras this.drawerBarras = new TgcDrawer2D(D3DDevice.Instance.Device); //Creo la letra para el texto this.letraJugadores = new TgcDrawText(D3DDevice.Instance.Device, "Rock it", 10, MediaDir); /* * if (MultiplicadorPos == 0) * this.cantVidaJugador = 100; * * if (MultiplicadorPos == 1) * this.cantVidaJugador = 20; * * if (MultiplicadorPos == 2) * this.cantVidaJugador = 20; * * if (MultiplicadorPos == 3) * this.cantVidaJugador = 50; * * if (MultiplicadorPos == 4) * this.cantVidaJugador = 40; */ //Creo las barras de vida this.CargarBarraDeVida(); return; }
private void DibujarGanador(string NombreGanador) { TgcDrawText letraGanador; letraGanador = new TgcDrawText(D3DDevice.Instance.Device, "Rock it", 36, MediaDir); letraGanador.drawText("FIN DEL JUEGO", (Convert.ToInt32(D3DDevice.Instance.Width) / 2) - 200, (Convert.ToInt32(D3DDevice.Instance.Height) / 2) - 150, Color.Green); letraGanador.drawText("GANÓ " + NombreGanador.Trim(), (Convert.ToInt32(D3DDevice.Instance.Width) / 2) - 200, (Convert.ToInt32(D3DDevice.Instance.Height) / 2), Color.Green); }
public HUDTiempo(string MediaDirectory, int TiempoDeJuego) { //Guardo variables this.MediaDir = MediaDirectory; this.TiempoDeJuego = TiempoDeJuego; //Creo la letra para el texto this.letraJugadores = new TgcDrawText(D3DDevice.Instance.Device, "Rock it", 10, MediaDir); }
/// <summary> /// Crea todos los modulos necesarios de la aplicacion /// </summary> internal void initGraphics(MainForm mainForm, Control panel3d) { this.mainForm = mainForm; this.panel3d = panel3d; this.fullScreenPanel = new FullScreenPanel(); panel3d.Focus(); //Iniciar graficos this.tgcD3dDevice = new TgcD3dDevice(panel3d); this.texturesManager = new TgcTexture.Manager(); this.tgcD3dDevice.OnResetDevice(tgcD3dDevice.D3dDevice, null); //Iniciar otras herramientas this.texturesPool = new TgcTexture.Pool(); this.logger = new Logger(mainForm.LogConsole); this.text3d = new TgcDrawText(tgcD3dDevice.D3dDevice); this.tgcD3dInput = new TgcD3dInput(mainForm, panel3d); this.fpsCamera = new TgcFpsCamera(); this.rotCamera = new TgcRotationalCamera(); this.thirdPersonCamera = new TgcThirdPersonCamera(); this.axisLines = new TgcAxisLines(tgcD3dDevice.D3dDevice); this.userVars = new TgcUserVars(mainForm.getDataGridUserVars()); this.modifiers = new TgcModifiers(mainForm.getModifiersPanel()); this.elapsedTime = -1; this.frustum = new TgcFrustum(); this.mp3Player = new TgcMp3Player(); this.directSound = new TgcDirectSound(); this.fog = new TgcFog(); this.currentCamera = this.rotCamera; this.customRenderEnabled = false; this.drawer2D = new TgcDrawer2D(); this.shaders = new TgcShaders(); //toogles this.rotCamera.Enable = true; this.fpsCamera.Enable = false; this.thirdPersonCamera.Enable = false; this.fpsCounterEnable = true; this.axisLines.Enable = true; //Cargar algoritmos exampleLoader = new ExampleLoader(); examplesDir = System.Environment.CurrentDirectory + "\\" + ExampleLoader.EXAMPLES_DIR + "\\"; examplesMediaDir = examplesDir + "Media" + "\\"; alumnoEjemplosDir = System.Environment.CurrentDirectory + "\\" + "AlumnoEjemplos" + "\\"; alumnoEjemplosMediaDir = alumnoEjemplosDir + "AlumnoMedia" + "\\"; exampleLoader.loadExamplesInGui(mainForm.TreeViewExamples, new string[] { examplesDir, alumnoEjemplosDir }); //Cargar shaders del framework this.shaders.loadCommonShaders(); //Cargar ejemplo default TgcExample defaultExample = exampleLoader.getExampleByName(mainForm.Config.defaultExampleName, mainForm.Config.defaultExampleCategory); executeExample(defaultExample); }
public HUDMenu(string MediaDir) { int fontSizeMenu = 18; int fontSizeTitulo = 36; if (D3DDevice.Instance.Width < 1280) { fontSizeMenu = 12; fontSizeTitulo = 28; this.DistanciaSeparacionMenu = 50; this.DistanciaSeparacionMenuControles = 50; this.DistanciaSeparacionTitulo_V = 250; this.DistanciaSeparacionTitulo_H = 70; this.DistanciaSeparacionNombre_H = 115; } this.MediaDir = MediaDir; this.letraMenu = new TgcDrawText(D3DDevice.Instance.Device, "Rock it", fontSizeMenu, MediaDir); this.letraTitulo = new TgcDrawText(D3DDevice.Instance.Device, "Rock it", fontSizeTitulo, MediaDir); this.EstadoMenu = "I"; }