mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-12-18 00:21:31 +00:00
cdc1f0c5e7
Now that qfcc actually supports them properly.
41 lines
562 B
R
41 lines
562 B
R
#include <gui/Text.h>
|
|
#include <string.h>
|
|
#include <draw.h>
|
|
|
|
@implementation Text
|
|
- (id) init
|
|
{
|
|
text = str_new ();
|
|
return self;
|
|
}
|
|
|
|
- (void) dealloc
|
|
{
|
|
str_free (text);
|
|
[super dealloc];
|
|
}
|
|
|
|
- (id) initWithBounds: (Rect)aRect
|
|
{
|
|
return [self initWithBounds:aRect text:""];
|
|
}
|
|
|
|
- (id) initWithBounds: (Rect)aRect text:(string)str
|
|
{
|
|
self = [super initWithBounds:aRect];
|
|
str_copy (text, str);
|
|
return self;
|
|
}
|
|
|
|
- (void) setText: (string)str
|
|
{
|
|
str_copy (text, str);
|
|
}
|
|
|
|
- (void) draw
|
|
{
|
|
local int maxlen = xlen / 8;
|
|
Draw_nString (xabs, yabs, text, maxlen);
|
|
}
|
|
|
|
@end
|