PolyScreenShape.h 1.3 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, float option1=0, float option2=0, float option3=0, float option4=0);
  24. ~ScreenShape();
  25. void Render();
  26. void setStrokeColor(float r, float g, float b, float a);
  27. void setStrokeWidth(float width);
  28. void setGradient(float r1, float g1, float b1, float a1, float r2, float g2, float b2, float a2);
  29. void clearGradient();
  30. void setShapeSize(float newWidth, float newHeight);
  31. void addShapePoint(float x, float 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. float option1;
  41. float option2;
  42. float option3;
  43. float option4;
  44. Polygon *customShapePoly;
  45. float strokeWidth;
  46. int shapeType;
  47. };
  48. }