Draw an Pixel arrow


/ Published in: ActionScript 3
Save to your folder(s)



Copy this code and paste it in your HTML
  1. // Draw left and right arrows
  2. // Pass through the graphics layer of an Sprite
  3.  
  4. public static function drawLeft(pGraphics : Graphics) : void {
  5.  
  6. pGraphics.moveTo(0, 0);
  7. pGraphics.drawRect(0, 0,5,1);
  8. pGraphics.drawRect(1, -1,1,1);
  9. pGraphics.drawRect(2, -2,1,1);
  10. pGraphics.drawRect(1, 1,1,1);
  11. pGraphics.drawRect(2, 2,1,1);
  12. }
  13.  
  14. public static function drawRight(pGraphics : Graphics) : void {
  15.  
  16. pGraphics.moveTo(0, 0);
  17. pGraphics.drawRect(0, 0,5,1);
  18. pGraphics.drawRect(4, -1,1,1);
  19. pGraphics.drawRect(3, -2,1,1);
  20. pGraphics.drawRect(4, 1,1,1);
  21. pGraphics.drawRect(3, 2,1,1);
  22. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.