override public void Render(TgcFrustum frustum)
        {
            ClearScreen();

            skyBox.Render();

            drawer.BeginDrawSprite();
            //drawer.DrawSprite(spriteSubnautica);
            drawer.DrawSprite(spriteBlackRectangle);
            drawer.DrawSprite(title);
            drawer.EndDrawSprite();

            DrawTextSmall.drawText("Start", (int)x, yStartWord, colors[(int)pointer]);
            DrawTextSmall.drawText("Exit", (int)x, yStartWord + yOffset, colors[(((int)pointer) + 1) % 2]);
            DrawTextSmall.drawText("->", (int)x - 40, yStartWord + (int)pointer * yOffset, Color.OrangeRed);

            if (Cheats.GodMode)
            {
                this.DrawTextSmall.drawText("God Mode", 300, 300, Color.Gold);
            }

            if (Cheats.StartingItems)
            {
                this.DrawTextSmall.drawText("Starting items", 300, 360, Color.Gold);
            }
        }
示例#2
0
        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();
            }
        }
示例#3
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();
            }
        }
示例#4
0
        public override void Render()
        {
            Scene.GetInstance().Render();

            /*this.textoVelocidadVehiculo.render();
             * this.textoPosicionVehiculo.render();
             * this.textoVectorAdelante.render();
             * this.textoOffsetF.render();
             * this.textoOffsetH.render();
             * textoArmaSeleccionada.render();
             * this.AIPosition.render();*/

            this.auto.Transform();
            this.auto.Render();

            this.AI.Transform();
            this.AI.Render();

            //this.manager.Transform();
            //this.manager.Render();

            drawer.BeginDrawSprite();

            drawer.DrawSprite(velocimeter);
            drawer.DrawSprite(arrowVelocimeter);
            drawer.DrawSprite(barOfLifeRed);
            drawer.DrawSprite(barOfLifeGreen);

            //Finalizar el dibujado de Sprites
            drawer.EndDrawSprite();
        }
 public void Render()
 {
     drawer2D.BeginDrawSprite();
     drawer2D.DrawSprite(spriteVelocimetro);
     drawer2D.DrawSprite(spriteAguja);
     drawer2D.EndDrawSprite();
 }
        public override void Render()
        {
            drawer.BeginDrawSprite();
            drawer.DrawSprite(pressStart);
            drawer.DrawSprite(title);
            drawer.EndDrawSprite();

            Scene.GetInstance().RenderRoom();
        }
示例#7
0
        public override void Render()
        {
            drawer.BeginDrawSprite();
            drawer.DrawSprite(choose);
            drawer.DrawSprite(rightArrow);
            drawer.DrawSprite(leftArrow);
            drawer.EndDrawSprite();

            this.planes.ForEach(x => x.Render());
            selectedCar.Render();
        }
        public override void Render(TgcFrustum frustum)
        {
            if (stateID == StateID.CLOSED)
            {
                return;
            }

            drawer.BeginDrawSprite();
            drawer.DrawSprite(darknessCover);
            drawer.DrawSprite(PDA);
            drawer.EndDrawSprite();

            this.itemHighlighted = null;

            if (stateID == StateID.OPENED)
            {
                bool       hovering   = false;
                TGCVector2 baseVector = PDA.Position + new TGCVector2(375, 175);
                drawer.BeginDrawSprite();
                byte xOffset         = 110;
                byte yOffset         = 110;
                byte maxItemsPerLine = 5;
                byte i = 0;
                foreach (var item in character.Inventory.Items)
                {
                    int x = i % maxItemsPerLine;
                    int y = i / maxItemsPerLine;
                    //text.drawText("-" + i++ + ": " + item.Name + " | " + item.Description + " | " + item.type.ToString(), 500, 300 + 30 * i, Color.White);
                    bubble.Position = baseVector + new TGCVector2(xOffset * x, yOffset * y);
                    if (cursorOverBubble())
                    {
                        bubble.Scaling       = bubbleDefaultScale + GetScaleForSpriteByPixels(bubble, 10, 10);
                        item.Icon.Scaling    = item.DefaultScale + GetScaleForSpriteByPixels(item.Icon, 10, 10);
                        hovering             = true;
                        this.itemHighlighted = item;
                    }
                    else
                    {
                        bubble.Scaling    = bubbleDefaultScale;
                        item.Icon.Scaling = item.DefaultScale;
                    }
                    CenterIconToCurrentBubble(item.Icon);
                    drawer.DrawSprite(bubble);
                    drawer.DrawSprite(item.Icon);
                    ++i;
                }

                cursor.Color = hovering ? Color.Yellow : cursorDefaultColor;
                drawer.DrawSprite(cursor);
                drawer.EndDrawSprite();
            }
        }
        public void Render()
        {
            int i = 1;

            if (musicaSel)
            {
                i = 0;
            }

            drawer2D.BeginDrawSprite();
            drawer2D.DrawSprite(opciones);
            drawer2D.DrawSprite(escenas[escenaSel]);
            drawer2D.DrawSprite(musicas[i]);
            drawer2D.EndDrawSprite();
        }
 public void Render()
 {
     logica.Render();
     drawer2D.BeginDrawSprite();
     sprites.ForEach(s => drawer2D.DrawSprite(s));
     drawer2D.EndDrawSprite();
 }
示例#11
0
 public override void Render(float elapsedTime, Drawer2D drawer)
 {//renderizamos el sprite del botón
     drawer.BeginDrawSprite();
     drawer.DrawSprite(current_sprite);
     drawer.EndDrawSprite();
     drawText.drawText(nombre, (int)(Position.X + 20f), (int)(Position.Y + Size.Y / 2 - 20), System.Drawing.Color.White);
 }
示例#12
0
 public void Render()
 {
     drawer2D.BeginDrawSprite();
     drawer2D.DrawSprite(play);
     if (seleccion == 0)
     {
         drawer2D.DrawSprite(seleccion1);
     }
     else if (seleccion == 1)
     {
         drawer2D.DrawSprite(seleccion2);
     }
     else
     {
         drawer2D.DrawSprite(seleccion3);
     }
     drawer2D.EndDrawSprite();
 }
示例#13
0
        public override void Render()
        {
            PreRender();

            //Dibujar box3D. Se deben dibujar primero todos los objetos 3D. Recien al final dibujar los Sprites
            box.Render();

            //Iniciar dibujado de todos los Sprites de la escena (en este caso es solo uno)
            drawer2D.BeginDrawSprite();

            //Dibujar sprite (si hubiese mas, deberian ir todos aquí)
            drawer2D.DrawSprite(sprite);
            drawer2D.DrawSprite(animatedSprite);

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

            PostRender();
        }
示例#14
0
        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();
        }
        public override void Render(TgcFrustum frustum)
        {
            preRender();

            drawer.BeginDrawSprite();
            drawer.DrawSprite(darknessCover);
            drawer.EndDrawSprite();

            textBig.drawText("PAUSE", xTitle + 50, yTitle, Color.DarkGray);
            textSmall.drawText("BACK TO THE GAME", xTitle, yTitle + yOffsetFirstOption, colors[(int)pointer]);
            textSmall.drawText("GO TO START MENU", xTitle, yTitle + yOffsetFirstOption + ySecondOption, colors[(((int)pointer) + 1) % 2]);
            textSmall.drawText("->", xTitle - 45, yTitle + yOffsetFirstOption + (int)pointer * ySecondOption, Color.White);
        }
示例#16
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();
        }
示例#17
0
        public override void Render()
        {
            Scene.GetInstance().Render();

            this.auto.Transform();
            this.auto.Render();

            //this.manager.Transform();
            //this.manager.Render();

            drawer.BeginDrawSprite();

            drawer.DrawSprite(gameOver);

            //Finalizar el dibujado de Sprites
            drawer.EndDrawSprite();
        }
        private void Render()
        {
            preRender();

            drawer2D.BeginDrawSprite();
            drawer2D.DrawSprite(darknessCover);
            drawer2D.EndDrawSprite();

            if (darknessTransparency == maxDarknessTransparency)
            {
                int x1 = Screen.Width / 2 - 110;
                int y1 = Screen.Height / 2 + 20;
                int x2 = Screen.Width / 2 - 260;
                int y2 = Screen.Height / 2 + 35;
                DrawTextBig.drawText("YOU DIED", x1, y1, Color.FromArgb((int)letterTransparency, 175, 0, 0));
                DrawTextSmall.drawText("(Press Enter to go back to main menu)", x2, y2 + 60, Color.FromArgb((int)letterTransparency, 200, 200, 200));
            }
        }
示例#19
0
 public override void RenderSprites(Drawer2D drawer)
 {
     drawer.DrawSprite(slotBackground);
     drawer.DrawSprite(productSlot);
     drawer.DrawSprite(productSprite);
 }
示例#20
0
        /// <summary>
        /// Método que 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>
        /// <param name="elapsedTime">Tiempo en segundos transcurridos desde el último frame</param>
        public void render(float elapsedTime)
        {
            //Pongo la camara en posicion
            camara.OffsetForward = -12;
            camara.OffsetHeight  = 0;

            //Adelante
            if (this.main.Input.keyPressed(Key.UpArrow))
            {
                for (int i = 0; i < this.menus.Count; i++)
                {
                    if (this.menus[i].isSelect())
                    {
                        this.menus[i].Unselect();

                        if (i == 0)
                        {
                            this.menus[this.menus.Count - 1].Select();
                        }
                        else
                        {
                            this.menus[i - 1].Select();
                        }
                        break;
                    }
                }
            }

            //Atras
            if (this.main.Input.keyPressed(Key.DownArrow))
            {
                for (int i = 0; i < this.menus.Count; i++)
                {
                    if (this.menus[i].isSelect())
                    {
                        this.menus[i].Unselect();

                        if (i == this.menus.Count - 1)
                        {
                            this.menus[0].Select();
                        }
                        else
                        {
                            this.menus[i + 1].Select();
                        }
                        break;
                    }
                }
            }

            //Enter
            if (this.main.Input.keyPressed(Key.Return))
            {
                //TODO esto es muy horrible
                foreach (MenuItem item in this.menus)
                {
                    if (item.isSelect())
                    {
                        if (item.Nombre.Equals("picadito"))
                        {
                            this.main.PantallaActual = 1;
                            return;
                        }
                        if (item.Nombre.Equals("configuracion"))
                        {
                            this.configuracion = true;
                        }
                        if (item.Nombre.Equals("salir"))
                        {
                            this.exit();
                        }
                    }
                }
            }

            if (this.main.Input.keyPressed(Key.BackSpace))
            {
                this.configuracion = false;
            }

            if (configuracion)
            {
                //Iniciar dibujado de todos los Sprites de la escena (en este caso es solo uno)
                drawer2D.BeginDrawSprite();

                //Dibujar sprite (si hubiese mas, deberian ir todos aquí)
                drawer2D.DrawSprite(this.panelConfiguracion);

                //Finalizar el dibujado de Sprites
                drawer2D.EndDrawSprite();
            }
            else
            {
                this.pelota.rotateX(Geometry.DegreeToRadian(elapsedTime * 20));
                this.pelota.rotateY(Geometry.DegreeToRadian(elapsedTime * 15));
                this.pelota.rotateZ(Geometry.DegreeToRadian(elapsedTime * 10));

                this.pelota.updateValues();
                this.titulo.render();
                this.pelota.render();
                this.cancha.render();

                foreach (MenuItem item in this.menus)
                {
                    item.render();
                }
            }
        }
示例#21
0
        public override void Render()
        {
            PreRender();

            //Iniciar dibujado de todos los Sprites de la escena (en este caso es solo uno)
            drawer2D.BeginDrawSprite();

            //Aplicar las transformaciones necesarias y luego invocar al render. (ir comentando y descomentando para ver en pantalla.)

            //Ninguna transformación.
            sprite.TransformationMatrix = matrixIdentity;
            drawer2D.DrawSprite(sprite);

            //Rotamos y trasladamos.
            sprite.TransformationMatrix = rotation * traslation;
            //drawer2D.DrawSprite(sprite);

            //Aplicar en orden inverso a la rotación.
            sprite.TransformationMatrix = traslation * rotation;
            //drawer2D.DrawSprite(sprite);

            //Rotar en centro de pantalla.
            var pivotCentro    = TGCMatrix.Translation(-centroSprite.X, -centroSprite.Y, 0);
            var invPivotCentro = TGCMatrix.Translation(centroSprite.X, centroSprite.Y, 0);

            sprite.TransformationMatrix = pivotCentro * rotation * invPivotCentro * traslation;
            //drawer2D.DrawSprite(sprite);

            //Diferentes configuraciones de escalado.
            //Primero escalo luego muevo al centro de pantalla.
            sprite.TransformationMatrix = scaling * pivotCentro * rotation * invPivotCentro * traslation;
            //drawer2D.DrawSprite(sprite);

            //Primero muevo al centro de pantalla y escalo.
            sprite.TransformationMatrix = pivotCentro * rotation * invPivotCentro * traslation * scaling;
            //drawer2D.DrawSprite(sprite);

            //voy al centro de la imagen, roto y luego escalo, luego vuelvo al centro de la imagen y al centro de pantalla.
            sprite.TransformationMatrix = pivotCentro * rotation * scaling * invPivotCentro * traslation;
            //drawer2D.DrawSprite(sprite);

            //voy al centro de la imagen, escalo y luego roto, luego vuelvo al centro de la imagen y al centro de pantalla.
            sprite.TransformationMatrix = pivotCentro * scaling * rotation * invPivotCentro * traslation;
            //drawer2D.DrawSprite(sprite);

            //Como se puede apreciar las ultimas dos transformaciones dan igual resultado.

            //¿que pasaría si el escalado no es uniforme?
            sprite.TransformationMatrix = pivotCentro * TGCMatrix.Scaling(1f, 0.5f, 1) * rotation * invPivotCentro * traslation;
            //drawer2D.DrawSprite(sprite);

            sprite.TransformationMatrix = pivotCentro * rotation * TGCMatrix.Scaling(1f, 0.5f, 1) * invPivotCentro * traslation;
            //drawer2D.DrawSprite(sprite);

            //Nos adelantamos un poco ..... ¿¿¿Animaciones????

            sprite.TransformationMatrix = pivotCentro * scaling * rotationAnimateFrameDepend * invPivotCentro * traslation;
            //drawer2D.DrawSprite(sprite);

            //Cada un segundo se actualiza la matriz.
            sprite.TransformationMatrix = pivotCentro * scaling * rotationAnimateOneSec * invPivotCentro * traslation;
            //drawer2D.DrawSprite(sprite);

            sprite.TransformationMatrix = pivotCentro * scaling * rotationAnimate * invPivotCentro * traslation;
            //drawer2D.DrawSprite(sprite);

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

            PostRender();
        }
示例#22
0
        private void RenderPartido(float elapsedTime)
        {
            if (Input.keyPressed(Key.F10))
            {
                this.partido.ReiniciarPosiciones();
                return;
            }

            if (Input.keyPressed(Key.F9))
            {
                this.partido.SetCamaraAerea();
                return;
            }

            if (Input.keyPressed(Key.F8))
            {
                this.partido.SetCamaraPelota();
                return;
            }

            //Todavia no inicio el partido
            if (!this.tiempo)
            {
                //TODO podria ser que Configuracion reciba el partido y haga como si fuera su builder, no lo termino de ver aun :P
                string pathTexturaPelota           = this.configuracionPartido.GetPelotaActual().Texture.FilePath;
                string pathTexturaJugadorLocal     = this.configuracionPartido.GetJugadorLocalActual().DiffuseMaps[0].FilePath;
                string pathTexturaJugadorVisitante = this.configuracionPartido.GetJugadorVisitanteActual().DiffuseMaps[0].FilePath;
                string estiloDeCamara = this.configuracionPartido.GetCamara();

                if (estiloDeCamara.Equals("Pelota"))
                {
                    this.partido.SetCamaraPelota();
                }

                if (estiloDeCamara.Equals("Aérea"))
                {
                    this.partido.SetCamaraAerea();
                }

                this.menu.close();
                this.configuracionPartido.close();

                this.partido.SetTexturasSeleccionadas(pathTexturaPelota, pathTexturaJugadorLocal, pathTexturaJugadorVisitante);
                this.partido.ReiniciarPosiciones();

                this.tiempo = true;
                this.partido.Marcador.IniciarTiempo();
            }

            //BoundingBox
            //this.partido.MostrarBounding = (bool)GuiController.Instance.Modifiers["BoundingBox"];

            //Inteligencia Artificial
            //this.partido.InteligenciaArtificial = (bool)GuiController.Instance.Modifiers["IA"];

            this.partido.render(elapsedTime);

            //Iniciar dibujado de todos los Sprites de la escena (en este caso es solo uno)
            drawer2D.BeginDrawSprite();

            //Dibujar sprite (si hubiese mas, deberian ir todos aquí)
            drawer2D.DrawSprite(this.mapa);
            this.RenderJugadoresMapa(this.partido.EquipoLocal.Jugadores, this.puntoAzul);
            this.RenderJugadoresMapa(this.partido.EquipoVisitante.Jugadores, this.puntoNaranja);

            //Finalizar el dibujado de Sprites
            drawer2D.EndDrawSprite();
        }
示例#23
0
 public override void Render(float ElapsedTime, Drawer2D drawer)
 {
     drawer.DrawSprite(sprite);
 }
        public override void Render(TgcFrustum tgcFrustum)
        {
            ClearScreen();

            ShaderRepository.ShipAmbientShader.SetValue("cameraPosition", new float[4] {
                Camera.Position.X, Camera.Position.Y, Camera.Position.Z, 1
            });

            GameState.character.Render();

            ship.Render();

            var   lookedThings   = selectableThings.Where(t => t.Looked).ToList();
            Thing newLookedThing = null;

            if (lookedThings.Count() == 0)
            {
                lookedThing = null;
            }
            else
            {
                newLookedThing = lookedThings[0];
                if (newLookedThing != lookedThing)
                {
                    dialogBox.Open();
                    lookedThing = newLookedThing;
                }
                dialogBox.Clear();
                if (cursor != null)
                {
                    newLookedThing.BoundingBox.Render();
                    dialogBox.AddLineSmall(newLookedThing.name);
                    dialogBox.AddLineSmall("------------");
                    dialogBox.AddLineSmall(newLookedThing.actionDescription);
                    dialogBox.Render();
                    cursor = hand;
                }
            }

            foreach (var thing in selectableThings)
            {
                thing.Render();
            }

            lifeBelt.Position = new TGCVector3(285, 1000, 250);
            lifeBelt.Render();
            lifeBelt.Position = new TGCVector3(330, 1000, 100);
            lifeBelt.Render();
            lifeBelt.Position = new TGCVector3(375, 1000, -50);
            lifeBelt.Render();

            seat.Render();

            if (cursor != null)
            {
                drawer2D.BeginDrawSprite();
                drawer2D.DrawSprite(cursor);
                drawer2D.EndDrawSprite();

                cursor = aim;
            }

            inventoryScene.Render();
            craftingScene.Render();


            //this.drawText.drawText("Pause: P\nInventory: TAB\nExit ship: click the hatch in the floor\nCraft: click the crafter, press ESC to exit crafting",
            //    300, 300, Color.NavajoWhite);

            //this.drawText.drawText("Camera:", 800, 100, Color.Red);
            //this.drawText.drawText("X: " + Camera.Position.X, 800, 130, Color.White);
            //this.drawText.drawText("Y: " + Camera.Position.Y, 800, 160, Color.White);
            //this.drawText.drawText("Z: " + Camera.Position.Z, 800, 190, Color.White);

            //crafter.Render();
            //s.Render();

            statsIndicators.Render(this.GameState.character);
        }
示例#25
0
 public override void Render(float elapsedTime, Drawer2D drawer)
 {
     drawer.DrawSprite(sprites[currentSprite]);
 }
 public void Render()
 {
     drawer2D.BeginDrawSprite();
     drawer2D.DrawSprite(sprites[siguiente]);
     drawer2D.EndDrawSprite();
 }
示例#27
0
        private void MainRender()
        {
            cursor = arrow;

            if (crafted != null)
            {
                var item = Items.Crafter.Crafteables.Find(elem => elem == crafted);

                ShaderRepository.ShipAmbientShader.SetValue("lightPosition", new float[4] {
                    655, 1220, 504, 1
                });
                ShaderRepository.ShipAmbientShader.SetValue("perlinNoise", perlinNoise);
                ShaderRepository.ShipAmbientShader.SetValue("time", time);
                foreach (var mesh in crafted3DModel)
                {
                    mesh.Effect = ShaderRepository.ShipAmbientShader;
                    ShaderRepository.ShipAmbientShader.SetValue("rotation", Matrix.RotationX(mesh.Rotation.X) * Matrix.RotationY(mesh.Rotation.Y));
                    mesh.Technique = "CraftedItems";
                    mesh.RotateY(0.025f);

                    D3DDevice.Instance.Device.RenderState.AlphaBlendEnable = true;
                    mesh.Render();
                }

                //laser1.Render();
                //laser2.Render();

                item.Icon.Scaling  = item.DefaultScale * 4;
                item.Icon.Position = new TGCVector2(
                    Screen.Width / 2 - item.Icon.Bitmap.Width * item.Icon.Scaling.X / 2,
                    Screen.Height / 2
                    );

                var cursorPos = System.Windows.Forms.Cursor.Position;

                if (
                    cursorPos.X > Screen.Width * 0.4f &&
                    cursorPos.X < Screen.Width * 0.6f &&
                    cursorPos.Y > Screen.Height * 0.3f &&
                    cursorPos.Y < Screen.Height * 0.8f
                    )
                {
                    cursor      = hand;
                    aboutToTake = true;
                }
                else
                {
                    aboutToTake = false;
                }


                drawer.BeginDrawSprite();
                //drawer.DrawSprite(item.Icon);
                drawer.DrawSprite(cursor);
                drawer.EndDrawSprite();

                return;
            }

            bool hovering = false;
            int  i        = 0;

            dialogBox.Clear();

            foreach (var item in Items.Crafter.Crafteables)
            {
                item.Icon.Scaling = item.DefaultScale + this.GetScaleForSpriteByPixels(item.Icon, 10, 10);

                bubble.Position = new TGCVector2(bubbleInitialPos.X, bubbleInitialPos.Y + i++ *bubble.Bitmap.Height * bubble.Scaling.Y);
                CenterIconToCurrentBubble(item.Icon);

                if (cursorOverBubble())
                {
                    //bubble.Color = Color.Red;
                    ItemHighlighted = item;
                    hoveredItems[Items.Crafter.Crafteables.IndexOf(item)] = true;
                    hovering = true;
                    dialogBox.AddLineBig(item.Name + "       ", this.Character.CanCraft(item) ? Color.FromArgb(255, 0, 255, 0) : Color.Red);
                    dialogBox.AddLineSmall("(" + item.type.ToString() + ")", Color.Gray);
                    dialogBox.AddLineSmall("____________________");
                    dialogBox.AddLineSmall(item.Description);
                    dialogBox.AddLineSmall("____________________");
                    dialogBox.AddLineSmall("Recipe:");
                    foreach (var ingredient in item.Recipe.Ingredients)
                    {
                        bool fulfills = this.Character.Inventory.Items.Where(it => it.Name.Equals(ingredient.Item.Name)).Count() >= ingredient.Quantity;
                        dialogBox.AddLineSmall(ingredient.Item.Name + ": " + ingredient.Quantity, fulfills ? Color.FromArgb(255, 0, 255, 0) : Color.Red);
                    }
                }
                else
                {
                    hoveredItems[Items.Crafter.Crafteables.IndexOf(item)] = false;
                }

                this.bubble.Color =
                    this.Character.CanCraft(item)
                            ? Color.White
                            : Color.Black;

                drawer.BeginDrawSprite();
                drawer.DrawSprite(bubble);
                drawer.DrawSprite(item.Icon);
                drawer.EndDrawSprite();
            }

            if (hovering)
            {
                dialogBox.Render();
            }

            this.cursor.Color = hovering ? Color.FromArgb(255, 0, 255, 0) : this.cursorDefaultColor;
            drawer.BeginDrawSprite();
            drawer.DrawSprite(cursor);
            drawer.EndDrawSprite();
        }
        //private readonly NumberIndicator loadIndicator = new NumberIndicator(100, (Screen.Width-100)/2, (Screen.Height-100)/2);

        public override void Render(TgcFrustum frustum)
        {
            ClearScreen();
            ShaderRepository.WorldWaterFog.SetValue("cameraPosition", new Vector4(Camera.Position.X, Camera.Position.Y, Camera.Position.Z, 1));
            GameState.character.Render();
            if (GameState.character.Weapon != null && GameState.character.Weapon.Mesh != null)
            {
                GameState.character.Weapon.Mesh.Effect    = ShaderRepository.WorldWaterFog;
                GameState.character.Weapon.Mesh.Technique = "WorldWaterFog";
            }

            if (!this.loaded)
            {
                var oldColor = this.backgroundColor;
                this.backgroundColor = Color.Black;
                ClearScreen();
                //TODO loading screen

                /* indicator
                 * var max = this.World.generating;
                 * var progress = this.World.chunks.Count * 100 / (max != 0 ? max : 1);
                 *
                 * loadIndicator.Render(progress , 100);
                 * loadIndicator.RenderText(progress);
                 */

                var color = Color.DeepSkyBlue;

                this.DrawText.drawText("Loading...", 600, 300, color);
                this.DrawText.drawText("Chunnks: " + this.World.chunks.Count + "/" + this.World.generating, 600, 330, color);
                this.DrawText.drawText("Floors: " + FloorRepository.Floors.Count + "/" + FloorRepository.generating, 600, 360, color);
                this.backgroundColor = Color.Green;

                return;
            }

            //if (Camera.Position.Y < 0)
            //{
            //    foreach (var mesh in skyBoxUnderwater.Faces)
            //    {
            //        mesh.Effect = ShaderRepository.WorldWaterFog;
            //        mesh.Technique = "WorldWaterFog";
            //    }
            //    skyBoxUnderwater.Render();
            //}
            //else
            //{
            //    foreach (var mesh in skyBoxOutside.Faces)
            //    {
            //        mesh.Effect = ShaderRepository.WorldWaterFog;
            //        mesh.Technique = "WorldWaterFog";
            //    }
            //   skyBoxOutside.Render();
            //}

            if (Camera.Position.Y < 0)
            {
                theSkybox.Render(new Vector4(Camera.Position.X, Camera.Position.Y, Camera.Position.Z, 1));
            }
            else
            {
                theSkybox.Render();
            }

            var camPos = new Vector4(Camera.Position.X, Camera.Position.Y, Camera.Position.Z, 1);

            waterSurface.Render(camPos);
            ShaderRepository.WorldWaterFog.SetValue("cameraPosition", camPos);
            World.Render(Camera, frustum);

            if (BoundingBox)
            {
                World.RenderBoundingBox(Camera);
            }
            orientationArrow.Render();

            drawer.BeginDrawSprite();
            //drawer.DrawSprite(waterVision);
            drawer.DrawSprite(cursor);
            drawer.EndDrawSprite();

            inventoryScene.Render();

            if (dialogName != "")
            {
                dialogBox.Clear();
                dialogBox.AddLineBig(dialogName, Color.FromArgb(255, 204, 234, 255));
                dialogBox.AddLineSmall(dialogDescription, Color.FromArgb(255, 204, 234, 255));
                dialogBox.Render();
            }

            drawer.BeginDrawSprite();
            drawer.DrawSprite(mask);
            drawer.EndDrawSprite();
            statsIndicators.Render(GameState.character);

            /*
             * this.DrawText.drawText("Camera:", 800, 100, Color.Red);
             * this.DrawText.drawText("X: " + Camera.Position.X, 800, 130, Color.White);
             * this.DrawText.drawText("Y: " + Camera.Position.Y, 800, 160, Color.White);
             * this.DrawText.drawText("Z: " + Camera.Position.Z, 800, 190, Color.White);
             */
        }