PolyScreenShape.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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 "PolyGlobals.h"
  12. #include "PolyCoreServices.h"
  13. #include "PolyScreenEntity.h"
  14. #include "PolyScreenMesh.h"
  15. #include "PolyPolygon.h"
  16. #include "PolyMesh.h"
  17. #include <string>
  18. using std::string;
  19. namespace Polycode {
  20. class _PolyExport ScreenShape : public ScreenMesh {
  21. public:
  22. ScreenShape(int shapeType, float option1=0, float option2=0, float option3=0, float option4=0);
  23. ~ScreenShape();
  24. void Render();
  25. void setStrokeColor(float r, float g, float b, float a);
  26. void setStrokeWidth(float width);
  27. void setGradient(float r1, float g1, float b1, float a1, float r2, float g2, float b2, float a2);
  28. void clearGradient();
  29. void setShapeSize(float newWidth, float newHeight);
  30. void addShapePoint(float x, float y);
  31. static const int SHAPE_RECT = 1;
  32. static const int SHAPE_CIRCLE = 2;
  33. static const int SHAPE_CIRCLE_OUTLINE = 3;
  34. static const int SHAPE_CUSTOM = 4;
  35. bool strokeEnabled;
  36. Color strokeColor;
  37. bool lineSmooth;
  38. protected:
  39. float option1;
  40. float option2;
  41. float option3;
  42. float option4;
  43. Polygon *customShapePoly;
  44. float strokeWidth;
  45. int shapeType;
  46. };
  47. }