Commits

Paweł Wieczorek  committed 1470037 Draft

minor

  • Participants
  • Parent commits 7987f56

Comments (0)

Files changed (4)

File src/Resource.ml

 
 type resourceFont =
     { nameFont      : string
+    ; sizeFont      : int
     ; mutable font  : Sdlttf.font option
     }
 
 let prepare_image name =
   { id = MkImageId (-1) ; name = name ; image = None }
 
-let prepare_font name =
-  {  nameFont = name ; font = None }
+let prepare_font name size =
+  {  nameFont = name ; font = None ; sizeFont = size }
 
 
 (**************************************************************************
   let img_water = prepare_image "water-32x32"
   let img_rock  = prepare_image "rock-32x32"
 
-  let font_txt  = prepare_font "speculum"
+  let font_txt18  = prepare_font "speculum" 18
 
   let resources =
     [ Image img_grass
     ; Image img_water
     ; Image img_rock
-    ; Font  font_txt
+    ; Font  font_txt18
     ]
 
 end
   | Font f ->
       let path = to_ustring (List.rev [ "res" ; "ttf" ; f.nameFont ^ ".ttf" ]) in
       Printf.printf " - loading font %s\n%!" path;
-      let font = Sdlttf.open_font path 18 in
+      let font = Sdlttf.open_font path f.sizeFont in
       f.font <- Some font
 
 

File src/Resource.mli

 
 type resourceFont =
     { nameFont      : string
+    ; sizeFont      : int
     ; mutable font  : Sdlttf.font option
     }
 
   sig
     val img_grass : resourceImage
     val img_water : resourceImage
-    val img_rock : resourceImage
-    val font_txt : resourceFont
+    val img_rock  : resourceImage
+
+    val font_txt18 : resourceFont
   end
 

File src/UI/UI_Button.ml

 let draw_button params text (x, y, w, h) surface =
     let fparams = mk_frame_params params in
     draw_frame fparams (x,y,w,h) surface;
-    draw_text (get_font PAK0.font_txt.font) (0,0,0) text (x+3,y+3) surface
+    draw_text (get_font PAK0.font_txt18.font) (0,0,0) text (x+3,y+3) surface
 
 let calculate_height params = 
     let fparams = mk_frame_params params in

File src/UI/UI_Panel.ml

     let rc_in   = draw_frame fparams (x,y,w,h) surface in
     let (rc_top, rc_bot) = split_hor rc_in UISettings.text_height in
     Video.draw_rect Color.cadet_grey rc_top surface;
-    draw_text (get_font PAK0.font_txt.font) (0,0,0) text (x+3,y+3) surface;
+    draw_text (get_font PAK0.font_txt18.font) (0,0,0) text (x+3,y+3) surface;
     narrow_rect rc_bot UISettings.panel_padding
 
 let calculate_height params =