예제 #1
0
 public void draw(SBWrapper wrapper)
 {
     wrapper.draw(bg);
     ui.draw(wrapper);
     if (editing)
     {
         editor.draw(wrapper);
     }
 }
예제 #2
0
        public void draw(SBWrapper wrapper, List <Entity> entities)
        {
            SBWrapper cameraSpace = new SBWrapper(wrapper, -location);

            map.draw(cameraSpace);
            for (int i = 0; i < entities.Count; i++)
            {
                entities[i].draw(wrapper, this);
            }
        }
예제 #3
0
 public void draw(SBWrapper wrapper)
 {
     wrapper.drawRectangle(new Vector2(Game1.INTERNAL_WIDTH, Game1.INTERNAL_HEIGHT), map.color);
     if (editing)
     {
         editor.draw(wrapper);
     }
     else
     {
         camera.draw(wrapper, entities);
         ui.draw(wrapper);
     }
 }
예제 #4
0
 public void draw(SBWrapper wrapper)
 {
     /*
      * int startX = Math.Max(0, (int) Math.Floor(-wrapper.location.X / Tile.TILE_SIZE));
      * int startY = Math.Max(0, (int)Math.Floor(-wrapper.location.Y / Tile.TILE_SIZE));
      * for (int x = startX; x < Math.Min(width, Game1.TILE_WIDTH); x++)
      * {
      *  for (int y = startY; y < Math.Min(height, Game1.TILE_HEIGHT); y++)
      *  {
      *      map[x, y].draw(wrapper, new Vector2(x, y) * Tile.TILE_SIZE);
      *  }
      * }
      */
     // TODO determine why above algorithm stopped working... drawing all tiles should work for now
     for (int x = 0; x < width; x++)
     {
         for (int y = 0; y < height; y++)
         {
             map[x, y].draw(wrapper, new Vector2(x, y) * Tile.TILE_SIZE);
         }
     }
 }
예제 #5
0
 /// <summary>
 /// Draw this entity at a screen location, without camera perspective
 /// </summary>
 /// <param name="wrapper"></param>
 /// <param name="location"></param>
 public void draw(SBWrapper wrapper, Vector2 location)
 {
     wrapper.draw(texture, location, animation.getFrame());
 }
예제 #6
0
 /// <summary>
 /// Draw this entity in world-space using a <see cref="TilemapCamera"/>
 /// </summary>
 /// <param name="wrapper"></param>
 /// <param name="camera"></param>
 public void draw(SBWrapper wrapper, TilemapCamera camera)
 {
     draw(wrapper, camera.worldToScreen(location));
 }
예제 #7
0
파일: Tile.cs 프로젝트: tapioca2k/lakeside2
 public void draw(SBWrapper wrapper, Vector2 location)
 {
     wrapper.draw(texture, location);
 }
예제 #8
0
 /// <summary>
 /// Create a new SBWrapper that draws at an offset relative to another SBWrapper
 /// </summary>
 /// <param name="other">The other SBWrapper</param>
 /// <param name="location">Offset from the origin of <paramref name="other"/> to use as the new origin</param>
 public SBWrapper(SBWrapper other, Vector2 location)
 {
     spriteBatch   = other.spriteBatch;
     this.location = other.location + location;
 }
예제 #9
0
 /// <summary>
 /// Create a new SBWrapper that is a copy of another
 /// </summary>
 /// <param name="other">SBWrapper to copy</param>
 public SBWrapper(SBWrapper other)
 {
     spriteBatch   = other.spriteBatch;
     this.location = other.location;
 }