Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Sprite/Sprite.cpp@8:21b6d4dbce44, 2019-04-19 (annotated)
- Committer:
- joshdavy
- Date:
- Fri Apr 19 17:54:09 2019 +0000
- Revision:
- 8:21b6d4dbce44
- Parent:
- 7:68e06dda79f7
- Child:
- 9:96969b1c6bde
Main menu added.;
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| joshdavy | 1:37802772843e | 1 | #include "Sprite.h" |
| joshdavy | 1:37802772843e | 2 | |
| joshdavy | 4:afbf3dd71403 | 3 | Sprite::Sprite() {} |
| joshdavy | 1:37802772843e | 4 | |
| joshdavy | 4:afbf3dd71403 | 5 | Sprite::~Sprite() {} |
| joshdavy | 1:37802772843e | 6 | |
| joshdavy | 1:37802772843e | 7 | void Sprite::init(int height,int width,int * bitmap,Vector2D pos) |
| joshdavy | 1:37802772843e | 8 | { |
| joshdavy | 1:37802772843e | 9 | _height = height; |
| joshdavy | 1:37802772843e | 10 | _width = width; |
| joshdavy | 1:37802772843e | 11 | _bitmap = bitmap; |
| joshdavy | 8:21b6d4dbce44 | 12 | _pos = pos; |
| joshdavy | 1:37802772843e | 13 | } |
| joshdavy | 1:37802772843e | 14 | |
| joshdavy | 3:b34685dbdb8d | 15 | void Sprite::update() |
| joshdavy | 2:b62e8be35a5d | 16 | { |
| joshdavy | 8:21b6d4dbce44 | 17 | |
| joshdavy | 2:b62e8be35a5d | 18 | } |
| joshdavy | 1:37802772843e | 19 | |
| joshdavy | 8:21b6d4dbce44 | 20 | void Sprite::render(N5110 &lcd) |
| joshdavy | 8:21b6d4dbce44 | 21 | { |
| joshdavy | 8:21b6d4dbce44 | 22 | |
| joshdavy | 8:21b6d4dbce44 | 23 | lcd.drawSprite(_pos.x,_pos.y,_height,_width, _bitmap); |
| joshdavy | 1:37802772843e | 24 | }; |
| joshdavy | 1:37802772843e | 25 | |
| joshdavy | 8:21b6d4dbce44 | 26 | Vector2D Sprite::getPos() |
| joshdavy | 8:21b6d4dbce44 | 27 | { |
| joshdavy | 1:37802772843e | 28 | return _pos; |
| joshdavy | 1:37802772843e | 29 | }; |
| joshdavy | 1:37802772843e | 30 | |
| joshdavy | 8:21b6d4dbce44 | 31 | void Sprite::setPos(Vector2D pos) |
| joshdavy | 8:21b6d4dbce44 | 32 | { |
| joshdavy | 1:37802772843e | 33 | _pos = pos; |
| joshdavy | 1:37802772843e | 34 | }; |
| joshdavy | 4:afbf3dd71403 | 35 | |
| joshdavy | 8:21b6d4dbce44 | 36 | void Sprite::setBitmap(int * bitmap) |
| joshdavy | 8:21b6d4dbce44 | 37 | { |
| joshdavy | 8:21b6d4dbce44 | 38 | _bitmap = bitmap ; |
| joshdavy | 4:afbf3dd71403 | 39 | }; |
| joshdavy | 7:68e06dda79f7 | 40 |