summaryrefslogtreecommitdiff
path: root/vfg/src/Puppet.h
diff options
context:
space:
mode:
authorTim Redfern <tim@gray.(none)>2012-11-22 11:00:03 +0000
committerTim Redfern <tim@gray.(none)>2012-11-22 11:00:03 +0000
commit9dc429df9dbd1a5ae0f93d553ccfde7ab37a53a2 (patch)
treec0891b8554cf6973aae12ade27bd85be2a1f6a09 /vfg/src/Puppet.h
parentb4d89c0a9029739d2af1705b371dc28f27b6d2dc (diff)
gameplay good: up against memory limit
Diffstat (limited to 'vfg/src/Puppet.h')
-rwxr-xr-xvfg/src/Puppet.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/vfg/src/Puppet.h b/vfg/src/Puppet.h
index e0df87a..7ee80ee 100755
--- a/vfg/src/Puppet.h
+++ b/vfg/src/Puppet.h
@@ -11,6 +11,13 @@
TODO: make resolution independent
*/
+class puppetSprite: public ofxSprite {
+ public:
+ void draw(float x, float y, float scale) {
+ getCurrentImage().draw(x-(anchorPoint.x*scale),y-(anchorPoint.y*scale),getWidth()*scale,getHeight()*scale);
+ }
+};
+
class Puppet
{
public:
@@ -19,11 +26,11 @@ class Puppet
void load(string filename);
void play(string clip);
void playNow(string clip);
- void draw(float x, float y);
+ void draw(float x, float y, float scale=1.0f);
bool isPlaying();
protected:
private:
- map<string,ofxSprite> clips;
+ map<string,puppetSprite> clips;
deque<string> playlist;
};