PolyScreenShape.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * PolyScreenShape.h
  3. * Poly
  4. *
  5. * Created by Ivan Safrin on 5/6/08.
  6. * Copyright 2008 __MyCompanyName__. All rights reserved.
  7. *
  8. */
  9. // @package Screen
  10. #pragma once
  11. #include "PolyString.h"
  12. #include "PolyGlobals.h"
  13. #include "PolyCoreServices.h"
  14. #include "PolyScreenEntity.h"
  15. #include "PolyScreenMesh.h"
  16. #include "PolyPolygon.h"
  17. #include "PolyMesh.h"
  18. #include <string>
  19. using std::string;
  20. namespace Polycode {
  21. class _PolyExport ScreenShape : public ScreenMesh {
  22. public:
  23. ScreenShape(int shapeType, Number option1=0, Number option2=0, Number option3=0, Number option4=0);
  24. ~ScreenShape();
  25. void Render();
  26. void setStrokeColor(Number r, Number g, Number b, Number a);
  27. void setStrokeWidth(Number width);
  28. void setGradient(Number r1, Number g1, Number b1, Number a1, Number r2, Number g2, Number b2, Number a2);
  29. void clearGradient();
  30. void setShapeSize(Number newWidth, Number newHeight);
  31. void addShapePoint(Number x, Number y);
  32. static const int SHAPE_RECT = 1;
  33. static const int SHAPE_CIRCLE = 2;
  34. static const int SHAPE_CIRCLE_OUTLINE = 3;
  35. static const int SHAPE_CUSTOM = 4;
  36. bool strokeEnabled;
  37. Color strokeColor;
  38. bool lineSmooth;
  39. protected:
  40. Number option1;
  41. Number option2;
  42. Number option3;
  43. Number option4;
  44. Polygon *customShapePoly;
  45. Number strokeWidth;
  46. int shapeType;
  47. };
  48. }