ofc_arrow.php 644 B

123456789101112131415161718192021222324252627
  1. <?php
  2. class ofc_arrow
  3. {
  4. /**
  5. *@param $x as number. Start x position
  6. *@param $y as number. Start y position
  7. *@param $a as number. End x position
  8. *@param $b as number. End y position
  9. *@param $colour as string.
  10. *@param $barb_length as number. Length of the barbs in pixels.
  11. */
  12. function ofc_arrow($x, $y, $a, $b, $colour, $barb_length=10)
  13. {
  14. $this->type = "arrow";
  15. $this->start = array("x"=>$x, "y"=>$y);
  16. $this->end = array("x"=>$a, "y"=>$b);
  17. $this->colour($colour);
  18. $this->{"barb-length"} = $barb_length;
  19. }
  20. function colour( $colour )
  21. {
  22. $this->colour = $colour;
  23. return $this;
  24. }
  25. }