Library for 3.2'' uLcd Picaso Display4D system Picaso Serial Environment Command Set web: http://www.4dsystems.com.au/product/20/67/Processors_Graphics/PICASO/
Sprite.h@1:a74e42cf52b2, 2015-04-05 (annotated)
- Committer:
- adelino
- Date:
- Sun Apr 05 13:54:48 2015 +0000
- Revision:
- 1:a74e42cf52b2
PicasoLib version 2
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
adelino | 1:a74e42cf52b2 | 1 | #ifndef SPRITE_H |
adelino | 1:a74e42cf52b2 | 2 | #define SPRITE_H |
adelino | 1:a74e42cf52b2 | 3 | |
adelino | 1:a74e42cf52b2 | 4 | #include "mbed.h" |
adelino | 1:a74e42cf52b2 | 5 | #include "Screen.h" |
adelino | 1:a74e42cf52b2 | 6 | |
adelino | 1:a74e42cf52b2 | 7 | |
adelino | 1:a74e42cf52b2 | 8 | class Sprite: public Widget |
adelino | 1:a74e42cf52b2 | 9 | { |
adelino | 1:a74e42cf52b2 | 10 | public: |
adelino | 1:a74e42cf52b2 | 11 | /** Construct a Sprite |
adelino | 1:a74e42cf52b2 | 12 | * |
adelino | 1:a74e42cf52b2 | 13 | * @param mScreen the pointer screen |
adelino | 1:a74e42cf52b2 | 14 | * @param _id the identifier Id |
adelino | 1:a74e42cf52b2 | 15 | * @params _x the up left |
adelino | 1:a74e42cf52b2 | 16 | * @params _y the up left |
adelino | 1:a74e42cf52b2 | 17 | * @params _w the width |
adelino | 1:a74e42cf52b2 | 18 | * @params _h the height |
adelino | 1:a74e42cf52b2 | 19 | * @param _color the background color |
adelino | 1:a74e42cf52b2 | 20 | */ |
adelino | 1:a74e42cf52b2 | 21 | // constructor |
adelino | 1:a74e42cf52b2 | 22 | // |
adelino | 1:a74e42cf52b2 | 23 | Sprite(Screen* mScreen,UINT16 _id,UINT16 _x,UINT16 _y,UINT16 _w,UINT16 _h,Color _color); |
adelino | 1:a74e42cf52b2 | 24 | |
adelino | 1:a74e42cf52b2 | 25 | virtual ~Sprite(); |
adelino | 1:a74e42cf52b2 | 26 | |
adelino | 1:a74e42cf52b2 | 27 | virtual void draw(void); |
adelino | 1:a74e42cf52b2 | 28 | |
adelino | 1:a74e42cf52b2 | 29 | //! test a overlap |
adelino | 1:a74e42cf52b2 | 30 | bool overlapWith(Sprite* pObj); |
adelino | 1:a74e42cf52b2 | 31 | // |
adelino | 1:a74e42cf52b2 | 32 | static bool overlap(Sprite* pObj1,Sprite* pObj2); |
adelino | 1:a74e42cf52b2 | 33 | // |
adelino | 1:a74e42cf52b2 | 34 | |
adelino | 1:a74e42cf52b2 | 35 | |
adelino | 1:a74e42cf52b2 | 36 | //getter |
adelino | 1:a74e42cf52b2 | 37 | float getSpeedX(void) const; |
adelino | 1:a74e42cf52b2 | 38 | float getSpeedY(void) const; |
adelino | 1:a74e42cf52b2 | 39 | |
adelino | 1:a74e42cf52b2 | 40 | //setter |
adelino | 1:a74e42cf52b2 | 41 | |
adelino | 1:a74e42cf52b2 | 42 | void setInvertSpeedX(void); |
adelino | 1:a74e42cf52b2 | 43 | void setInvertSpeedY(void); |
adelino | 1:a74e42cf52b2 | 44 | void setSpeedX(float _speedX); |
adelino | 1:a74e42cf52b2 | 45 | void setSpeedY(float _speedY); |
adelino | 1:a74e42cf52b2 | 46 | void setSpeedXY(float _speedX,float _speedY); |
adelino | 1:a74e42cf52b2 | 47 | |
adelino | 1:a74e42cf52b2 | 48 | void setUpdateAutomatic(bool _state); |
adelino | 1:a74e42cf52b2 | 49 | bool getUpdateAutomatic(void) const; |
adelino | 1:a74e42cf52b2 | 50 | |
adelino | 1:a74e42cf52b2 | 51 | protected: |
adelino | 1:a74e42cf52b2 | 52 | void elementUpdate(void); |
adelino | 1:a74e42cf52b2 | 53 | |
adelino | 1:a74e42cf52b2 | 54 | bool myIsUpdateAutomatic; |
adelino | 1:a74e42cf52b2 | 55 | float mySpeedX,mySpeedY; |
adelino | 1:a74e42cf52b2 | 56 | |
adelino | 1:a74e42cf52b2 | 57 | UINT16 myXMoveMin,myXMoveMax,myYMoveMin,myYMoveMax; |
adelino | 1:a74e42cf52b2 | 58 | |
adelino | 1:a74e42cf52b2 | 59 | }; |
adelino | 1:a74e42cf52b2 | 60 | |
adelino | 1:a74e42cf52b2 | 61 | #endif |