Exemple #1
0
        /// <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();

            //BackgroundColor
            D3DDevice.Instance.Device.Clear(ClearFlags.Target | ClearFlags.ZBuffer, Color.Black, 1.0f, 0);
            ClearTextures();

            //Dibuja un texto por pantalla
            DrawText.drawText("Con la tecla F se dibuja el bounding box.", 0, 20, Color.OrangeRed);
            DrawText.drawText("Posición del personaje: " + TGCVector3.PrintVector3(personaje.Position), 0, 40, System.Drawing.Color.Red);
            //Render personaje
            //personaje.Render();
            personaje.animateAndRender(ElapsedTime);
            //Render escenas
            RenderEscenas();
            //Render obstaculos
            RenderObstaculos();
            if (huboColision)
            {
                DrawText.drawText("PERDISTE!!!: ", 500, 20, System.Drawing.Color.WhiteSmoke);
            }

            //Render de BoundingBox, muy útil para debug de colisiones.
            if (BoundingBox)
            {
                BoundingBoxPersonajeYObstaculos();
            }

            //Render del SkyBox
            skyBox.Render();

            PostRender();
        }
Exemple #2
0
 /// <summary>
 ///     Dibuja el contador de FPS si esta activo
 /// </summary>
 protected void RenderFPS()
 {
     if (FPS)
     {
         DrawText.drawText(HighResolutionTimer.FramesPerSecondText(), 0, 0, Color.Yellow);
     }
 }
Exemple #3
0
        private void RenderHelpText()
        {
            DrawText.changeFont((new System.Drawing.Font("TimesNewRoman", 12)));
            DrawText.drawText("Objetos Total: \n" + terreno.SceneMeshes.Count, 0, 20, Color.OrangeRed);
            DrawText.drawText("Objetos Renderizados: \n" + terreno.totalMeshesRenderizados, 0, 100, Color.OrangeRed);

            //DrawText.drawText("tiempoFogataEncendida: \n" + tiempoFogataEncendida, 200, 20, Color.OrangeRed);


            //DrawText.drawText("Objetos Cercanos: \n" + objetosCerca, 200, 20, Color.OrangeRed);
            //DrawText.drawText("Camera position: \n" + Camara.Position, 0, 200, Color.OrangeRed);
            //DrawText.drawText("Fogata position: \n" + terreno.fogata.Position, 0, 300, Color.OrangeRed);

            /*
             * DrawText.drawText("Camera (Coordenada X Original): \n" + (int)(Camara.Position.X / terreno.SceneScaleXZ), 200, 20, Color.OrangeRed);
             * DrawText.drawText("Camera (Coordenada Z Original): \n" + (int)(Camara.Position.Z / terreno.SceneScaleXZ), 200, 100, Color.OrangeRed);
             * DrawText.drawText("usoHorario: \n" + (usoHorario/570)*24, 200, 20, Color.OrangeRed);
             * DrawText.drawText("usoHorario: \n" + usoHorario, 200, 20, Color.OrangeRed);
             * DrawText.drawText("Camera position: \n" + Camara.Position, 0, 20, Color.OrangeRed);
             * DrawText.drawText("Camera LookAt: \n" + Camara.LookAt, 0, 100, Color.OrangeRed);
             * DrawText.drawText("Camera (Coordenada X Original): \n" + (int)(Camara.Position.X / terreno.SceneScaleXZ), 200, 20, Color.OrangeRed);
             * DrawText.drawText("Camera (Coordenada Z Original): \n" + (int)(Camara.Position.Z / terreno.SceneScaleXZ), 200, 100, Color.OrangeRed);
             * DrawText.drawText("Camera (Coordenada Y Terreno): \n" + terreno.CalcularAlturaTerreno((int)(Camara.Position.X / terreno.SceneScaleXZ), (int)(Camara.Position.Z / terreno.SceneScaleXZ)), 200, 180, Color.OrangeRed);
             * DrawText.drawText("Posicion Personaje: \n" + personaje.Posicion, 0, 300, Color.OrangeRed);
             */
        }
Exemple #4
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();
 }
Exemple #5
0
 /// <summary>
 /// Dibuja el contador de FPS si esta activo.
 /// </summary>
 protected void RenderFPS()
 {
     if (FPSText)
     {
         DrawText.drawText(Timer.FramesPerSecondText(), 0, 0, Color.Yellow);
     }
 }
 public Game2DManager(string mediaDir)
 {
     MousePointer    = new DrawSprite(mediaDir);
     InstructionText = new DrawText();
     InitializerMousePointer();
     InitializerInstructionText();
 }
Exemple #7
0
 public void OnLoad()
 {
     Variables.Hero = ObjectManager.LocalHero;
     this.pause     = Variables.Hero.ClassId != ClassId.CDOTA_Unit_Hero_Visage;
     if (this.pause)
     {
         return;
     }
     Variables.MenuManager     = new MenuManager(Me.Name);
     Variables.Familiars       = ObjectManager.GetEntities <Unit>().Where(unit => unit.Name.Contains("npc_dota_visage_familiar") && unit.IsAlive).ToList();
     Variables.graveChill      = new GraveChill(Me.Spellbook.Spell1);
     Variables.soulAssumption  = new SoulAssumption(Me.Spellbook.Spell2);
     Variables.familiarControl = new FamiliarControl();
     Variables.MenuManager.Menu.AddToMainMenu();
     Variables.EnemyTeam      = Me.GetEnemyTeam();
     this.familiarAutoLastHit = new FamiliarAutoLast();
     this.autoNuke            = new AutoNuke();
     this.follow      = new Follow();
     this.drawText    = new DrawText();
     this.targetFind  = new TargetFind();
     this.combo       = new Combo();
     this.talentAbuse = new TalentAbuse();
     Game.PrintMessage(
         "VisageSharp" + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version + " loaded");
 }
Exemple #8
0
        private void Drawing_OnDraw(EventArgs args)
        {
            if (!IsStacking || !IsValid)
            {
                return;
            }

            campNameTextPosition = HUDInfo.GetHPbarPosition(Unit)
                                   + new Vector2((GetHpBarSizeX - MeasureCampNameTextSize.X) / 2, IsHero ? 25 : 0);

            if (campNameTextPosition.IsZero)
            {
                return;
            }
            var text = CurrentCamp.Name;

            if (Debug)
            {
                text += " (" + CurrentStatus + ")";
            }

            var campName = new DrawText
            {
                Position = campNameTextPosition, Text = text, Color = Color.White,
                TextSize = new Vector2(16)
            };

            if (IsUnderCampNameText && !IsHero)
            {
                campName.Color = Color.Orange;
            }

            campName.Draw();
        }
Exemple #9
0
 public LoneDruidSharp()
 {
     this.autoIronTalon = new AutoIronTalon();
     this.autoMidas     = new AutoMidas();
     this.lasthit       = new Lasthit();
     this.drawText      = new DrawText();
 }
Exemple #10
0
        private static void AddWaterMark(PdfGraphics graphics, DrawText drawText, PointF pointF)
        {
            SizeF waterTextSize = graphics.MeasureString(drawText.Text, drawText.FontText, PdfStringFormat.GenericDefault, DrawIngDpi, DrawIngDpi);

            graphics.RotateTransform(degree);//55 vertical letter//40horizontar letter//65LegarV//30 LegalH
            graphics.DrawString(drawText.Text, drawText.FontText, drawText.SolidBrush, pointF);
        }
Exemple #11
0
        public Button(
            Vector2 size,
            Vector2 position,
            string text,
            Color textColor,
            IUserInterfaceElement parent,
            Action action)
        {
            this.Parent     = parent;
            this.Size       = size;
            this.Position   = position;
            this.Color      = parent.Color;
            this.HoverColor = this.Color + new Color(50, 50, 50);
            this.PushColor  = new Color(this.Color.R - 50, this.Color.G - 50, this.Color.B - 50);
            this.Action     = action;
            this.Visible    = this.Parent.Visible;

            this.button = new DrawRect(this.Color)
            {
                Position = this.realPosition, Size = this.Size
            };
            this.text = new DrawText {
                Color = textColor, Text = text, TextSize = new Vector2(size.Y)
            };
            this.text.CenterOnRectangle(this.button);
        }
        public override void Render()
        {
            PreRender();

            //Obtener boolean para saber si hay que mostrar Bounding Box
            var showBB = showBoundingBoxModifier.Value;

            DrawText.drawText(text, 5, 20, System.Drawing.Color.Red);

            //Render piso
            piso.Render();

            //Render obstaculos
            foreach (var obstaculo in obstaculos)
            {
                obstaculo.Render();
                if (showBB)
                {
                    obstaculo.BoundingBox.Render();
                }
            }

            //Render personaje
            personaje.animateAndRender(ElapsedTime);
            if (showBB)
            {
                personaje.BoundingBox.Render();
            }

            PostRender();
        }
Exemple #13
0
        public override void Render()
        {
            PreRender();

            //Ver si se seleccionó alguno nivel a empaquetar
            var selectedFile = openFileModifier.Value;

            if (selectedFile != currentFile)
            {
                currentFile = selectedFile;

                //Cargar nivel
                var loader = new BspLoader();
                var bspMap = loader.loadBsp(currentFile, quake3MediaPath);

                //Empaquetar
                var info      = new FileInfo(currentFile);
                var fileName  = info.Name.Substring(0, info.Name.IndexOf('.'));
                var outputDir = info.DirectoryName + "\\" + fileName;

                loader.packLevel(bspMap, quake3MediaPath, outputDir);

                //Librer recursos
                bspMap.dispose();

                MessageBox.Show("Empaquetado almacenado en: " + outputDir, "Result", MessageBoxButtons.OK, MessageBoxIcon.Information);

                DrawText.drawText("Este ejemplo no posee salida gráfica. verificar código y sus comentarios.", 5, 50, Color.OrangeRed);
            }

            PostRender();
        }
Exemple #14
0
        private static void InitPropertyDict()
        {
            //drawobj
            int count = DrawObj.GetPropertyNames().Length;

            for (int i = 0; i < count; i++)
            {
                _propertyIndexDict.Add(DrawObj.GetPropertyNames()[i], new PropertyIndex((int)DrawType.Obj, i));
            }

            //drawvector
            count = DrawVector.GetPropertyNames().Length;
            for (int i = 0; i < count; i++)
            {
                _propertyIndexDict.Add(DrawVector.GetPropertyNames()[i], new PropertyIndex((int)DrawType.Vector, i));
            }

            //drawtext
            count = DrawText.GetPropertyNames().Length;
            for (int i = 0; i < count; i++)
            {
                _propertyIndexDict.Add(DrawText.GetPropertyNames()[i], new PropertyIndex((int)DrawType.Text, i));
            }

            //todo add control:variable
        }
Exemple #15
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 Shark2D(string MediaDir, SharkStatus status)
 {
     Status        = status;
     LifeShark     = new DrawSprite(MediaDir);
     LifeSharkText = new DrawText();
     InitializerLifeShark();
 }
Exemple #17
0
 public LoneDruidSharp()
 {
     autoIronTalon = new AutoIronTalon();
     autoMidas     = new AutoMidas();
     lasthit       = new Lasthit();
     drawText      = new DrawText();
 }
Exemple #18
0
        /// <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();

            //Dibuja un texto por pantalla
            DrawText.drawText("Con la tecla F se dibuja el bounding box.", 0, 20, Color.OrangeRed);
            DrawText.drawText("Con clic izquierdo subimos la camara [Actual]: " + TGCVector3.PrintTGCVector3(Camera.Position), 0, 30, Color.OrangeRed);

            //Siempre antes de renderizar el modelo necesitamos actualizar la matriz de transformacion.
            //Debemos recordar el orden en cual debemos multiplicar las matrices, en caso de tener modelos jerárquicos, tenemos control total.
            Box.Transform = TGCMatrix.Scaling(Box.Scale) * TGCMatrix.RotationYawPitchRoll(Box.Rotation.Y, Box.Rotation.X, Box.Rotation.Z) * TGCMatrix.Translation(Box.Position);
            //A modo ejemplo realizamos toda las multiplicaciones, pero aquí solo nos hacia falta la traslación.
            //Finalmente invocamos al render de la caja
            Box.Render();

            //Cuando tenemos modelos mesh podemos utilizar un método que hace la matriz de transformación estándar.
            //Es útil cuando tenemos transformaciones simples, pero OJO cuando tenemos transformaciones jerárquicas o complicadas.
            Mesh.UpdateMeshTransform();
            //Render del mesh
            Mesh.Render();

            //Render de BoundingBox, muy útil para debug de colisiones.
            if (BoundingBox)
            {
                Box.BoundingBox.Render();
                Mesh.BoundingBox.Render();
            }

            //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();
        }
        public void OnLoad()
        {
            Variables.Hero = ObjectManager.LocalHero;
            Orbwalker.Hero = ObjectManager.LocalHero;
            pause          = Variables.Hero.Name != "npc_dota_hero_huskar";
            if (this.pause)
            {
                return;
            }
            Variables.Hero        = ObjectManager.LocalHero;
            Variables.MenuManager = new MenuManager(Me.Name);
            Variables.MenuManager.Menu.AddToMainMenu();
            Variables.EnemyTeam = Me.GetEnemyTeam();
            Variables.LifeBreak = new LifeBreak(Me.Spellbook.SpellR);
            Variables.Satanic   = new Satanic(Me.FindItem("item_satanic"));
            Variables.Pike      = new Pike(Me.FindItem("item_hurricane_pike"));
            Variables.Illusions = ObjectManager.GetEntities <Unit>().Where(unit => unit.Name == "npc_dota_hero_huskar").ToList();
            this.targetFind     = new TargetFind();
            this.combo          = new Combo();
            this.drawText       = new DrawText();
            this.autoArmlet     = new AutoArmlet();
            this.autoLifebreak  = new AutoLifeBreak();
            this.autoPike       = new AutoPike();


            Game.PrintMessage(
                "HuskarSharp" + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version + " is loaded!");
        }
Exemple #20
0
        /// <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();

            //Dibuja un texto por pantalla
            //DrawText.drawText("Con la tecla F se dibuja el bounding box.", 0, 20, Color.OrangeRed);
            DrawText.drawText("Posicion de la camara [Actual]: " + TGCVector3.PrintVector3(Camara.Position), 0, 20, Color.OrangeRed);
            DrawText.drawText("Posicion del personaje [Actual]: " + TGCVector3.PrintVector3(tgcPersonaje.getPosicion()), 0, 30, Color.OrangeRed);
            DrawText.drawText("Presionar F para ver las boundingBox", 0, 40, Color.OrangeRed);
            DrawText.drawText("Vector direccion personaje" + TGCVector3.PrintVector3(tgcPersonaje.getOrientacion()), 0, 50, Color.OrangeRed);
            DrawText.drawText("Vector direccion colision" + TGCVector3.PrintVector3(tgcPersonaje.getVectorColision()), 0, 60, Color.OrangeRed);

            skyBox.Render();
            tgcPersonaje.Render();
            escenario1.Render();
            //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

            //Mostrar los boundingBox correspondientes, no es algo que el personaje deba poder hacer pero es para ver que
            if (boundingBox)
            {
                tgcPersonaje.DrawBoundingBox();
                //Cuando tengamos varios escenarios tendríamos que hacer
                //escenarioActual.DrawBoundingBox();
                //Con escenarioActual variable del gameModel
                escenario1.DrawBoundingBox();
            }
            PostRender();
        }
Exemple #21
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="Notification" /> class.
        /// </summary>
        /// <param name="duration">
        ///     The duration.
        /// </param>
        /// <param name="position">
        ///     The position.
        /// </param>
        /// <param name="size">
        ///     The size.
        /// </param>
        public Notification(float duration, Vector2 position, Vector2 size)
        {
            this.Duration            = duration;
            this.alliesNearbySleeper = new Sleeper();
            this.Position            = position;
            this.positionOn          = position - new Vector2(size.X + 1, 0);
            this.positionOff         = position + new Vector2(1, 0);
            this.Size         = size;
            this.Visible      = true;
            this.HeroIconSize = new Vector2((float)(size.X / 2.9), (float)(size.Y / 1.5));
            this.chargeText   = new DrawText
            {
                Text     = "DETONATE", Color = Color.White, FontFlags = FontFlags.AntiAlias,
                Position = new Vector2(), TextSize = new Vector2((float)(this.HeroIconSize.Y / 2.1))
            };
            this.healthText = new DrawText
            {
                Text     = string.Empty, Color = Color.White, FontFlags = FontFlags.AntiAlias,
                Position = new Vector2(), TextSize = new Vector2((float)(this.HeroIconSize.Y / 3.1))
            };
            this.moveCameraText = new DrawText
            {
                Text     = "MOVE CAMERA", Color = Color.White, FontFlags = FontFlags.AntiAlias,
                Position = new Vector2(),
                TextSize = new Vector2((float)(this.HeroIconSize.Y / 3.4))
            };

            this.keyText = new DrawText
            {
                Text     = string.Empty, Color = Color.White, FontFlags = FontFlags.AntiAlias,
                Position = new Vector2(), TextSize = new Vector2((float)(this.HeroIconSize.Y / 2.5))
            };
            this.transition = new QuadEaseOut(1.5);
            this.transition.Start(this.positionOn, this.positionOff);
        }
Exemple #22
0
    // Creates a Text pop up at the world position
    public static void TextPopup(string text, Vector3 position, float height = 2f, float time = 4f, int size = 24, Color?color = null)
    {
        color = color ?? Color.white;
        var target   = Helpers.SetY(position, position.y + height);
        var textMesh = DrawText.CreateWorldTextPopup(text, position, target: target, time: time, fontSize: size, color: color);

        textMesh.transform.parent = GameObject.Find("TextMeshInstances").transform;
    }
        public override void Render()
        {
            PreRender();

            DrawText.drawText("Este ejemplo no muestra nada por pantalla. Sino que es para leer el codigo y sus comentarios.", 5, 50, Color.Yellow);

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

            sceneRecover.renderAll();
            DrawText.drawText("Camera pos: " + TgcParserUtils.printVector3(Camara.Position), 5, 20, Color.Red);
            DrawText.drawText("Camera LookAt: " + TgcParserUtils.printVector3(Camara.LookAt), 5, 40, Color.Red);
            PostRender();
        }
        public override void Render()
        {
            PreRender();

            sceneRecover.RenderAll();
            DrawText.drawText("Camera pos: " + TGCVector3.PrintTGCVector3(Camera.Position), 5, 20, Color.Red);
            DrawText.drawText("Camera LookAt: " + TGCVector3.PrintTGCVector3(Camera.LookAt), 5, 40, Color.Red);
            PostRender();
        }
Exemple #26
0
        private void DibujarDebug()
        {
            DrawText.drawText("GodMode = ON", 600, 40, Color.OrangeRed);
            DrawText.drawText("F = bounding box.", 0, 20, Color.OrangeRed);
            DrawText.drawText("posicion camara: " + TgcParserUtils.printVector3(Camara.Position), 0, 30, Color.OrangeRed);
            DrawText.drawText("GodMode = OFF", 0, 40, Color.White);
            DrawText.drawText("v=", 0, 50, Color.Orange);
            DrawText.drawText(AutoJugador.Velocidad.ToString(), 20, 50, Color.Orange);
            //DrawText.drawText("ruedas=", 0, 60, Color.Green);
            //DrawText.drawText(AutoJugador.DireccionRuedas.ToString(), 50, 60, Color.Green);

            DrawText.drawText("angOrientacionMesh=", 0, 70, Color.White);
            DrawText.drawText((AutoJugador.angOrientacionMesh * 180 / (float)Math.PI).ToString(), 160, 70, Color.White);

            DrawText.drawText("MeshPosition=", 0, 80, Color.White);
            DrawText.drawText(AutoJugador.Mesh.Position.ToString(), 100, 80, Color.White);



            DrawText.drawText("scale mesh = ", 0, 160, Color.White);
            DrawText.drawText(AutoJugador.Mesh.Scale.ToString(), 100, 160, Color.White);

            DrawText.drawText("obb center = ", 0, 220, Color.White);
            DrawText.drawText(AutoJugador.obb.Center.ToString(), 100, 220, Color.White);

            DrawText.drawText("bounding position = ", 0, 280, Color.White);
            DrawText.drawText(AutoJugador.Mesh.BoundingBox.ToString(), 150, 280, Color.White);

            //DrawText.drawText("collisionFound = ", 0, 340, Color.White);
            //DrawText.drawText(AutoJugador.collisionFound.ToString(), 150, 340, Color.White);

            DrawText.drawText("direccionRuedas = ", 0, 400, Color.White);
            DrawText.drawText(AutoJugador.DireccionRuedas.ToString(), 150, 400, Color.White);

            DrawText.drawText("posicion luz ", 0, 420, Color.White);
            DrawText.drawText(pointLuz.lighthPos.ToString(), 150, 420, Color.White);

            DrawText.drawText("choco adelante ", 0, 480, Color.White);
            DrawText.drawText(AutoJugador.chocoAdelante.ToString(), 150, 480, Color.White);

            DrawText.drawText("t= ", 230, 520, Color.White);
            DrawText.drawText(autoOponente.tiempoEspera.ToString(), 250, 580, Color.Orange);

            /*
             * DrawText.drawText("time ", 0, 500, Color.White);
             *
             *
             * DrawText.drawText(minString+":"+ segString, 150, 500, Color.White);*/

            if (BoundingBox)
            {
                //Box.BoundingBox.render();
                // Mesh.BoundingBox.render();
                AutoJugador.Mesh.BoundingBox.render();
                MapScene.BoundingBox.render();
            }
        }
Exemple #27
0
 public RunePosition(Vector3 position, string name, Team team)
 {
     this.Position = position;
     this.text     = new DrawText {
         Shadow = true, Color = Color.White, Size = new Vector2(20 * HUDInfo.Monitor)
     };
     this.Name = name;
     this.Team = team;
 }
        public override void Render()
        {
            PreRender();
            DrawText.drawText("Cantidad de elementos liberados: " + disposed, 5, 20, Color.Red);

            //Renderisamos todo hasta que pase cierto tiempo y ahi liberamos todos los recursos.
            if (time >= 0f && time < 30f)
            {
                var d3dMesh = new Mesh(boxMesh.NumberTriangles, boxMesh.NumberVertices, MeshFlags.Managed,
                                       TgcSceneLoader.VertexColorVertexElements, D3DDevice.Instance.Device);

                var origVert = (TgcSceneLoader.VertexColorVertex[])boxMesh.D3dMesh.LockVertexBuffer(
                    typeof(TgcSceneLoader.VertexColorVertex), LockFlags.ReadOnly, boxMesh.D3dMesh.NumberVertices);

                boxMesh.D3dMesh.UnlockVertexBuffer();

                var newVert = (TgcSceneLoader.VertexColorVertex[])d3dMesh.LockVertexBuffer(
                    typeof(TgcSceneLoader.VertexColorVertex), LockFlags.None, d3dMesh.NumberVertices);

                for (var i = 0; i < origVert.Length; i++)
                {
                    newVert[i]             = origVert[i];
                    newVert[i].Position.Y += time;
                }

                d3dMesh.UnlockVertexBuffer();

                boxMesh.changeD3dMesh(d3dMesh);

                //Render de todas las palmeras.
                foreach (var m in meshes)
                {
                    m.Render();
                }

                //Render de una esena.
                scene1.RenderAll();

                //Render de la caja.
                boxMesh.Render();

                time += ElapsedTime;
            }
            else
            {
                //ATENCION ESTO QUE SIGUE es solo para el ejemplo este, no es buena practica invocar al dispose completo.
                //En su lugar se puede invocar caso por caso segun las necidades.
                //Hacemos el dispose 1 vez sola.
                if (time != -1)
                {
                    time = -1;
                    Dispose();
                }
            }

            PostRender();
        }
        public override void Render()
        {
            PreRender();
            DrawText.drawText("Camera pos: " + TGCVector3.PrintVector3(Camara.Position), 5, 20, Color.Red);
            //Renderizar SkyBox
            skyBox.Render();

            PostRender();
        }
 public Character2D(string MediaDir, CharacterStatus status)
 {
     Status     = status;
     Life       = new DrawSprite(MediaDir);
     Oxygen     = new DrawSprite(MediaDir);
     LifeText   = new DrawText();
     OxygenText = new DrawText();
     Init();
 }
        private GameplayScreen()
        {
            TransitionOnTime = TimeSpan.FromSeconds(1.5);
            TransitionOffTime = TimeSpan.FromSeconds(0.5);

            random = new MyRandom(Environment.TickCount);
            zunePad = new ZunePad();
            highScores = new Highscores(this);
            drawText = new DrawText(this);
            drawPrims = new DrawPrims(this);
            boidManager = new BoidManager(this);
            particles = new ParticleSystem(this);
            world = new World(this);
            player = new Player(this);
        }
 public void SetDrawText(DrawText function)
 {
     mDrawText = function;
 }
Exemple #33
0
        private static void Initialize()
        {
            if (Utility.Map.GetMap().Type == Utility.Map.MapType.SummonersRift)
            {
                // Blue: Blue Buff
                _jungleCamps.Add(
                    new JungleCamp(
                        "SRU_Blue", 300, new Vector3(3388.2f, 8400f, 55.2f),
                        new[] { "SRU_Blue1.1.1", "SRU_BlueMini1.1.2", "SRU_BlueMini21.1.3" },1));

                // Blue: Wolves
                _jungleCamps.Add(
                    new JungleCamp(
                        "SRU_Murkwolf", 100, new Vector3(3415.8f, 6950f, 55.6f),
                        new[] { "SRU_Murkwolf2.1.1", "SRU_MurkwolfMini2.1.2", "SRU_MurkwolfMini2.1.3" },2));

                // Blue: Chicken
                _jungleCamps.Add(
                    new JungleCamp(
                        "SRU_Razorbeak", 100, new Vector3(6500f, 5900f, 60f),
                        new[]
                        {
                            "SRU_Razorbeak3.1.1", "SRU_RazorbeakMini3.1.2", "SRU_RazorbeakMini3.1.3", "SRU_RazorbeakMini3.1.4"
                        },3));

                // Blue: Red Buff
                _jungleCamps.Add(
                    new JungleCamp(
                        "SRU_Red", 300, new Vector3(7300.4f, 4600.1f, 56.9f),
                        new[] { "SRU_Red4.1.1", "SRU_RedMini4.1.2", "SRU_RedMini4.1.3" },4));

                // Blue: Krug
                _jungleCamps.Add(
                    new JungleCamp(
                        "SRU_Krug", 100, new Vector3(7700.2f, 3200f, 54.3f),
                        new[] { "SRU_Krug5.1.2", "SRU_KrugMini5.1.1" },5));

                // Blue: Gromp
                _jungleCamps.Add(
                    new JungleCamp(
                        "SRU_Gromp", 100, new Vector3(1900.1f, 9200f, 54.9f), new[] { "SRU_Gromp13.1.1" },6));

                // Red: Blue Buff
                _jungleCamps.Add(
                    new JungleCamp(
                        "SRU_Blue", 300, new Vector3(10440f, 7500f, 54.9f),
                        new[] { "SRU_Blue7.1.1", "SRU_BlueMini7.1.2", "SRU_BlueMini27.1.3" },7));

                // Red: Wolves
                _jungleCamps.Add(
                    new JungleCamp(
                        "SRU_Murkwolf", 100, new Vector3(10350f, 9000f, 65.5f),
                        new[] { "SRU_Murkwolf8.1.1", "SRU_MurkwolfMini8.1.2", "SRU_MurkwolfMini8.1.3" },8));

                // Red: Chicken
                _jungleCamps.Add(
                    new JungleCamp(
                        "SRU_Razorbeak", 100, new Vector3(7100f, 10000f, 55.5f),
                        new[]
                        {
                            "SRU_Razorbeak9.1.1", "SRU_RazorbeakMini9.1.2", "SRU_RazorbeakMini9.1.3", "SRU_RazorbeakMini9.1.4"
                        },9));

                // Red: Red Buff
                _jungleCamps.Add(
                    new JungleCamp(
                        "SRU_Red", 300, new Vector3(6450.2f, 11400f, 54.6f),
                        new[] { "SRU_Red10.1.1", "SRU_RedMini10.1.2", "SRU_RedMini10.1.3" },10));

                // Red: Krug
                _jungleCamps.Add(
                    new JungleCamp(
                        "SRU_Krug", 100, new Vector3(6005f, 13000f, 39.6f),
                        new[] { "SRU_Krug11.1.2", "SRU_KrugMini11.1.1" },11));

                // Red: Gromp
                _jungleCamps.Add(
                    new JungleCamp("SRU_Gromp", 100, new Vector3(12000f, 7000f, 54.8f), new[] { "SRU_Gromp14.1.1" },12));

                // Neutral: Dragon
                _jungleCamps.Add(
                    new JungleCamp(
                        "SRU_Dragon", 360, new Vector3(9300.8f, 4200.5f, -60.3f), new[] { "SRU_Dragon6.1.1" },13));

                // Neutral: Baron
                _jungleCamps.Add(
                    new JungleCamp(
                        "SRU_Baron", 420, new Vector3(4300.1f, 11600.7f, -63.1f), new[] { "SRU_Baron12.1.1" },14));

                // Dragon: Crab
                _jungleCamps.Add(
                    new JungleCamp("Sru_Crab", 180, new Vector3(10600f, 5600.5f, -60.3f), new[] { "Sru_Crab15.1.1" },15));

                // Baron: Crab
                _jungleCamps.Add(
                    new JungleCamp("Sru_Crab", 180, new Vector3(4200.1f, 9900.7f, -63.1f), new[] { "Sru_Crab16.1.1" },16));

            }
            else if (Utility.Map.GetMap().Type == Utility.Map.MapType.TwistedTreeline)
            {
                // Blue: Wraiths
                _jungleCamps.Add(
                    new JungleCamp(
                        "TT_NWraith", 50, new Vector3(3550f, 6250f, 60f),
                        new[] { "TT_NWraith1.1.1", "TT_NWraith21.1.2", "TT_NWraith21.1.3" },1));

                // Blue: Golems
                _jungleCamps.Add(
                    new JungleCamp(
                        "TT_NGolem", 50, new Vector3(4500f, 8550f, 60f),
                        new[] { "TT_NGolem2.1.1", "TT_NGolem22.1.2" },2));

                // Blue: Wolves
                _jungleCamps.Add(
                    new JungleCamp(
                        "TT_NWolf", 50, new Vector3(5600f, 6400f, 60f),
                        new[] { "TT_NWolf3.1.1", "TT_NWolf23.1.2", "TT_NWolf23.1.3" },3));

                // Red: Wraiths
                _jungleCamps.Add(
                    new JungleCamp(
                        "TT_NWraith", 50, new Vector3(10300f, 6250f, 60f),
                        new[] { "TT_NWraith4.1.1", "TT_NWraith24.1.2", "TT_NWraith24.1.3" },4));

                // Red: Golems
                _jungleCamps.Add(
                    new JungleCamp(
                        "TT_NGolem", 50, new Vector3(9800f, 8550f, 60f),
                        new[] { "TT_NGolem5.1.1", "TT_NGolem25.1.2" },5));

                // Red: Wolves
                _jungleCamps.Add(
                    new JungleCamp(
                        "TT_NWolf", 50, new Vector3(8600f, 6400f, 60f),
                        new[] { "TT_NWolf6.1.1", "TT_NWolf26.1.2", "TT_NWolf26.1.3" },6));

                // Neutral: Vilemaw
                _jungleCamps.Add(
                    new JungleCamp(
                        "TT_Spiderboss", 300, new Vector3(7150f, 11100f, 60f),
                        new[] { "TT_Spiderboss8.1.1" },7));
            }
            if (_jungleCamps.Count > 0)
            {
                foreach (var camp in _jungleCamps)
                {
                    DrawText pos = new DrawText(camp);
                    _DrawText.Add(pos);
                }
                Game.OnUpdate += Game_OnGameUpdate;
                Drawing.OnEndScene += Drawing_OnEndScene;
                Game.PrintChat("JungleTimer loaded!");
            }
            else Game.PrintChat("Jungle Timer only supports SummonersRift and TwistedTreeline maps.");
        }