Beispiel #1
0
 public void draw(SpriteBatch sb)
 {
     if (type < 32 && cam.ifInRange(new Rectangle(x_pos, y_pos, 16, 16)))
     {
         sb.Draw(sprite, new Rectangle(x_pos - cam.X, y_pos - cam.Y, 16, 16), new Rectangle((type % 4) * 16, (type / 4) * 16, 16, 16), Color.White);
     }
     if (type >= 32 && cam.ifInRange(new Rectangle(x_pos, y_pos, 32, 32)))
     {
         sb.Draw(sprite, new Rectangle((int)(x_pos - cam.X + ((type - 32) % 4) * 16), (int)(y_pos - cam.Y + ((type - 32) / 4) * 16 - 64), 32, 32), new Rectangle((type % 4) * 16, (type / 4) * 16, 16, 16), Color.White);
     }
 }
Beispiel #2
0
 public void draw(SpriteBatch sb)
 {
     if (cam.ifInRange(new Rectangle(x_pos, y_pos, 16, 16)))
     {
         sb.Draw(sprite, new Rectangle(x_pos - cam.X, y_pos - cam.Y, 16, 16), new Rectangle((type % 4) * 16, (type / 4) * 16, 16, 16), Color.White);
     }
 }
Beispiel #3
0
 virtual public void draw(SpriteBatch sb)
 {
     //Camera must be initiated.
     if (cam != null)
     {
         //Now check if it's in the camera's range and it's not destroyed
         if (cam.ifInRange(comp.Mask) && isDestroyed == false && current_frame < max_frames)
         {
             //Draw the position relative to the camera
             sb.Draw(sprite, new Rectangle((int)x_pos - cam.X, (int)y_pos - cam.Y, width, height), clip[current_frame], Color.White);
         }
     }
     else
     {
         sb.Draw(sprite, new Rectangle((int)x_pos, (int)y_pos, width, height), clip[current_frame], Color.White);
     }
 }