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@2:b62e8be35a5d, 2019-04-02 (annotated)
- Committer:
- joshdavy
- Date:
- Tue Apr 02 10:45:44 2019 +0000
- Revision:
- 2:b62e8be35a5d
- Parent:
- 1:37802772843e
- Child:
- 3:b34685dbdb8d
Basic Sprite Rendering
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 | 1:37802772843e | 3 | |
| joshdavy | 1:37802772843e | 4 | |
| joshdavy | 1:37802772843e | 5 | Sprite::Sprite() |
| joshdavy | 1:37802772843e | 6 | { |
| joshdavy | 1:37802772843e | 7 | |
| joshdavy | 1:37802772843e | 8 | } |
| joshdavy | 1:37802772843e | 9 | |
| joshdavy | 1:37802772843e | 10 | Sprite::~Sprite() |
| joshdavy | 1:37802772843e | 11 | { |
| joshdavy | 1:37802772843e | 12 | |
| joshdavy | 1:37802772843e | 13 | } |
| joshdavy | 1:37802772843e | 14 | |
| joshdavy | 1:37802772843e | 15 | void Sprite::init(int height,int width,int * bitmap,Vector2D pos) |
| joshdavy | 1:37802772843e | 16 | { |
| joshdavy | 1:37802772843e | 17 | _height = height; |
| joshdavy | 1:37802772843e | 18 | _width = width; |
| joshdavy | 1:37802772843e | 19 | _bitmap = bitmap; |
| joshdavy | 1:37802772843e | 20 | _pos = pos; |
| joshdavy | 1:37802772843e | 21 | } |
| joshdavy | 1:37802772843e | 22 | |
| joshdavy | 2:b62e8be35a5d | 23 | void Sprite::update(Gamepad &pad) |
| joshdavy | 2:b62e8be35a5d | 24 | { |
| joshdavy | 2:b62e8be35a5d | 25 | |
| joshdavy | 2:b62e8be35a5d | 26 | } |
| joshdavy | 1:37802772843e | 27 | |
| joshdavy | 2:b62e8be35a5d | 28 | void Sprite::render(N5110 &lcd) { |
| joshdavy | 2:b62e8be35a5d | 29 | |
| joshdavy | 1:37802772843e | 30 | lcd.drawSprite(_pos.x,_pos.y,_height,_width, _bitmap); |
| joshdavy | 1:37802772843e | 31 | }; |
| joshdavy | 1:37802772843e | 32 | |
| joshdavy | 1:37802772843e | 33 | Vector2D Sprite::getPos() { |
| joshdavy | 1:37802772843e | 34 | return _pos; |
| joshdavy | 1:37802772843e | 35 | }; |
| joshdavy | 1:37802772843e | 36 | |
| joshdavy | 1:37802772843e | 37 | void Sprite::setPos(Vector2D pos) { |
| joshdavy | 1:37802772843e | 38 | _pos = pos; |
| joshdavy | 1:37802772843e | 39 | }; |
| joshdavy | 1:37802772843e | 40 | |
| joshdavy | 1:37802772843e | 41 |