~vcs-imports/openc2e/trunk

« back to all changes in this revision

Viewing changes to PointerAgent.cpp

  • Committer: fuzzie
  • Date: 2008-04-26 22:14:06 UTC
  • Revision ID: vcs-imports@canonical.com-20080426221406-y1qh3hsm801kt716
add hacky implementation of C1 speech/thought bubbles, unfinished

Show diffs side-by-side

added added

removed removed

Lines of Context:
266
266
        }
267
267
}
268
268
 
 
269
#include "Bubble.h"
 
270
 
 
271
void PointerAgent::makeNewSpeechBubble() {
 
272
        if (engine.version != 1) return; // TODO: C2 support
 
273
        
 
274
        bool leftside = false;
 
275
        // TODO: cope with wrap
 
276
        if (x - world.camera.getX() < world.camera.getWidth() / 2) leftside = true;
 
277
 
 
278
        // TODO: are 1/0 good colours?
 
279
        Bubble *ourSpeechBubble = new Bubble(2, 1, 1, 9000, "syst", leftside ? 12 : 11, 1, 6, 3, 144, 12, 1, 0);
 
280
        ourSpeechBubble->finishInit();
 
281
 
 
282
        ourSpeechBubble->attr = 32; // floating
 
283
        ourSpeechBubble->floatTo(this);
 
284
 
 
285
        // TODO: fix positioning
 
286
        if (leftside)
 
287
                ourSpeechBubble->moveTo(x + getWidth() - 2, y - ourSpeechBubble->getHeight());
 
288
        else
 
289
                ourSpeechBubble->moveTo(x - ourSpeechBubble->getWidth() + 2, y - ourSpeechBubble->getHeight());
 
290
 
 
291
        ourSpeechBubble->setEditing(true);
 
292
}
 
293
 
269
294
/* vim: set noet: */