hedgewars/uStore.pas
changeset 2620 796269129c47
parent 2619 bc2786a00fb8
child 2623 9332f744bbdf
equal deleted inserted replaced
2619:bc2786a00fb8 2620:796269129c47
   115 var w, h: LongInt;
   115 var w, h: LongInt;
   116     tmpsurf: PSDL_Surface;
   116     tmpsurf: PSDL_Surface;
   117     clr: TSDL_Color;
   117     clr: TSDL_Color;
   118     Result: TSDL_Rect;
   118     Result: TSDL_Rect;
   119 begin
   119 begin
   120 	TTF_SizeUTF8(Fontz[Font].Handle, Str2PChar(s), w, h);
   120 TTF_SizeUTF8(Fontz[Font].Handle, Str2PChar(s), w, h);
   121 	Result.x:= X;
   121 Result.x:= X;
   122 	Result.y:= Y;
   122 Result.y:= Y;
   123 	Result.w:= w + FontBorder * 2 + 4;
   123 Result.w:= w + FontBorder * 2 + 4;
   124 	Result.h:= h + FontBorder * 2;
   124 Result.h:= h + FontBorder * 2;
   125 	DrawRoundRect(@Result, cWhiteColor, cColorNearBlack, Surface, true);
   125 DrawRoundRect(@Result, cWhiteColor, cColorNearBlack, Surface, true);
   126 	clr.r:= Color shr 16;
   126 clr.r:= Color shr 16;
   127 	clr.g:= (Color shr 8) and $FF;
   127 clr.g:= (Color shr 8) and $FF;
   128 	clr.b:= Color and $FF;
   128 clr.b:= Color and $FF;
   129 	tmpsurf:= TTF_RenderUTF8_Blended(Fontz[Font].Handle, Str2PChar(s), clr.value);
   129 tmpsurf:= TTF_RenderUTF8_Blended(Fontz[Font].Handle, Str2PChar(s), clr.value);
   130 	tmpsurf:= doSurfaceConversion(tmpsurf);
   130 tmpsurf:= doSurfaceConversion(tmpsurf);
   131 	Result.x:= X + FontBorder + 2;
   131 Result.x:= X + FontBorder + 2;
   132 	Result.y:= Y + FontBorder;
   132 Result.y:= Y + FontBorder;
   133 	SDLTry(tmpsurf <> nil, true);
   133 SDLTry(tmpsurf <> nil, true);
   134 	SDL_UpperBlit(tmpsurf, nil, Surface, @Result);
   134 SDL_UpperBlit(tmpsurf, nil, Surface, @Result);
   135 	SDL_FreeSurface(tmpsurf);
   135 SDL_FreeSurface(tmpsurf);
   136 	Result.x:= X;
   136 Result.x:= X;
   137 	Result.y:= Y;
   137 Result.y:= Y;
   138 	Result.w:= w + FontBorder * 2 + 4;
   138 Result.w:= w + FontBorder * 2 + 4;
   139 	Result.h:= h + FontBorder * 2;
   139 Result.h:= h + FontBorder * 2;
   140 	WriteInRoundRect:= Result
   140 WriteInRoundRect:= Result
   141 end;
   141 end;
   142 
   142 
   143 procedure StoreLoad;
   143 procedure StoreLoad;
   144 var s: string;
   144 var s: string;
   145 
   145