5 * Created by Alyssa Milburn on Sat Apr 26 2008.
6 * Copyright (c) 2008 Alyssa Milburn. All rights reserved.
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
20 #include "CompoundAgent.h"
25 class Bubble
: public CompoundAgent
{
26 friend class BubblePart
;
29 class BubblePart
*ourPart
;
32 void turnIntoSpeech();
35 Bubble(unsigned char family
, unsigned char genus
, unsigned short species
, unsigned int plane
,
36 std::string spritefile
, unsigned int firstimage
, unsigned int imagecount
,
37 unsigned int tx
, unsigned int ty
, unsigned int twidth
, unsigned int theight
,
38 unsigned int bgcolour
, unsigned int tcolour
);
40 void setText(std::string s
);
41 std::string
getText();
43 void setEditing(bool e
);
45 void setTimeout(unsigned int i
);
49 class BubblePart
: public CompoundPart
{
53 BubblePart(Bubble
*p
, unsigned int _id
, int x
, int y
);
57 unsigned int textwidth
, textheight
;
58 unsigned int textoffset
;
59 unsigned int backgroundcolour
, textcolour
;
61 void setText(std::string s
);
64 void partRender(class Surface
*renderer
, int xoffset
, int yoffset
);
65 unsigned int getWidth() { return textwidth
; }
66 unsigned int getHeight() { return textheight
; }
68 bool canGainFocus() { return editable
; }
71 void handleKey(char c
);
72 void handleSpecialKey(char c
);