From c8223ce77a4dbf57be272d10c4e1d31f69bd516e Mon Sep 17 00:00:00 2001 From: xHire Date: Mon, 7 Apr 2008 19:34:00 +0000 Subject: - partially fixed bug #0004 - *only* issue with text in buttons and textfields - implemented build dir for normal game (=> not only server has build dir now) - the directory structure was extended with directories for packaging scripts git-svn-id: http://opensvn.csie.org/tuxanci_ng@44 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e --- src/widget_textfield.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/widget_textfield.c') diff --git a/src/widget_textfield.c b/src/widget_textfield.c index 8e8c229..fb3e902 100644 --- a/src/widget_textfield.c +++ b/src/widget_textfield.c @@ -60,7 +60,8 @@ static void drawText(widget_textfield_t *p) if( p->timeBlick > WIDGET_TEXTFIELD_TIME_BLICK_CURSOR/2 && p->active == TRUE ) { - strcat(str, ">"); + //strcat(str, ">"); + strcat(str, "\f"); } p->timeBlick++; @@ -70,7 +71,9 @@ static void drawText(widget_textfield_t *p) p->timeBlick = 0; } - drawFont(str, p->x+WIDGET_TEXTFIELD_TEXT_OFFSET_X, p->y+p->h/2, COLOR_WHITE); + //drawFont(str, p->x+WIDGET_TEXTFIELD_TEXT_OFFSET_X, p->y+p->h/2, COLOR_WHITE); + drawFont(str, p->x+WIDGET_TEXTFIELD_TEXT_OFFSET_X, p->y+WIDGET_TEXTFIELD_HEIGHT/2-p->h/2, COLOR_WHITE); + //printf("p->y: %d\nheight: %d\n p->h: %d\n", p->y, WIDGET_TEXTFIELD_HEIGHT, p->h); } void drawWidgetTextfield(widget_textfield_t *p) @@ -99,7 +102,7 @@ static void readKey(widget_textfield_t *p) mapa = SDL_GetKeyState(NULL); len = strlen(p->text); - //mazanie posledneho klavesu + // mazanie posledneho klavesu if( mapa[SDLK_BACKSPACE] == SDL_PRESSED ) { if( len > 0 ) @@ -117,7 +120,7 @@ static void readKey(widget_textfield_t *p) return; } - //klavesy abecedy + // klavesy abecedy for(i=SDLK_SPACE /*SDLK_a*/;i<=SDLK_z;i++) { //if(widthtime = WIDGET_TEXTFIELD_TIME_READ_KEY; + p->time = WIDGET_TEXTFIELD_TIME_READ_KEY; strcat( p->text, SDL_GetKeyName(i) ); getTextSize(p->text, &p->w, &p->h); return; -- cgit v1.2.3