code: public function getCss($id) {
          $total = $this->total_size();
          $top = $total["height"];
          $css = "";
          foreach ($this->images as $image) {
              if ($image["id"] == $id) {
                  $css .= "background-position:" . ($image["width"] - $total["width"]) . "px " . ($top - $total["height"]) . "px;";
                  $css .= "background-repeat:no-repeat;";
                  //$css .= "width: " . $image['width'] . "px; ";
                  //$css .= "height: " . $image['height'] . "px; ";
              }
              $top -= $image["height"];
          }
          return $css;
      }
docs: /*
  generates css code using ID provided when adding images or pseido ID "elem"
  $path parameter (optional) - takes path to already generated css_sprite file or uses default file for pseudo code generation