Exemple #1
0
    protected override void Draw(GameTime gameTime)
    {
        GraphicsDevice.Clear(Color.CornflowerBlue);

        //0 - background
        //1 - grass
        //1.5 - textures
        //2 - water
        //2.5 - roads
        //3 - places and doodads
        //5 - people
        //6 - clouds
        //7 - text
        //8 - ui
        //9 - mouse

        //world
        spriteBatch.Begin(SpriteSortMode.FrontToBack,
                          BlendState.NonPremultiplied,
                          SamplerState.PointClamp,
                          null,
                          null,
                          dayNightEffect,
                          camera.get_transformation(gdm));
        worldMap.Draw(spriteBatch, worldFont);
        spriteBatch.End();


        //mouse and ui
        spriteBatch.Begin(SpriteSortMode.FrontToBack,
                          BlendState.NonPremultiplied,
                          SamplerState.PointClamp,
                          null,
                          null,
                          null,
                          camera.get_transformation(gdm));

        mouse.Draw(spriteBatch, camera.cameraPosition, backbufferJamz, worldFont, uiHelper.areThereUIElementsOpen());
        time.Draw(spriteBatch, worldFont, returnPositionCameraOffset(timeUIPosition));


        travelHandler.DrawLocationUI(spriteBatch, worldFont, returnPositionCameraOffset(locationUIPosition), uiHelper.currentLocationIcon, uiHelper.destinationIcon);
        travelHandler.DrawPathOnMap(spriteBatch, uiHelper.mapPathingSheet);
        travelHandler.DrawIconOnMap(spriteBatch, uiHelper.mapLocationIcon);

        uiHelper.Draw(spriteBatch, returnPositionCameraOffset(Vector2.Zero), playerHandler);
        uiHelper.DrawMapUI(spriteBatch);


        spriteBatch.End();

        base.Draw(gameTime);
    }
Exemple #2
0
        public override void Draw(SpriteBatch spriteBatch)
        {
            try
            {
                spriteBatch.Clear();
                spriteBatch.Begin(samplerState: SamplerState.PointClamp, transformMatrix: Camera.GetMatrix());

                WorldMap.Draw(spriteBatch, (int)Controller.Player.X, (int)Controller.Player.Y);
                Controller.Draw(spriteBatch);
            }
            catch (InvalidOperationException) { }

            spriteBatch.End();
        }
Exemple #3
0
 public void Draw(SpriteBatch spriteBatch)
 {
     if (network.Connected)
     {
         spriteBatch.Draw(sky.Texture, new Rectangle(0, 0, WorldMap.Width * Universal.TILE_SIZE, sky.SourceHeight * 2), Color.White);
         WorldMap.Draw(spriteBatch);
         if (!online)
         {
             MainPlayer.Draw(spriteBatch);
             foreach (GameObject gameObject in objectList)
             {
                 gameObject.Draw(spriteBatch);
             }
         }
     }
 }