From: Cezary K. <ce...@cs...> - 2005-12-15 07:23:08
|
On Thursday 15 of December 2005 07:48, Pawel Parys wrote: > 1) Sprite collisions - should be possible to check in how many points > there is a collision or even to get the list of points. It is useful to > implement bouncing. This one is a really nice idea :) > 2) Printing text - it is impossible to write centered text or even check > the width of text. =46irst the width of a text:=20 =46rom font.mli: (Is it what you are looking for?) (** [width font str] returns width of string [str] written in font [font] *) val width : t -> string -> int;; Now centering of text: You would like the text centered relatively to what? The widgets that are being written (You can see something of them in action= in=20 Scorch, just press ESC and F2) do have a widget that centers anything insid= e=20 it, so if you put a text inside such widget it is centered relatively to th= e=20 whole big widget... So you will be able to center relatively to a menu item= ,=20 or a split-screen half.=20 So they are not completely designed, that's why they are not in main MLG... Do I understand correct, that you want to center relatively to the context = on=20 which you draw the string? It is also an interesting idea... > 3) Delay - on my slow computer the game works slower than on faster one. > There is only variable Helpers.delay which is constant, but possibly there > are less frames that it says. I'd like to check the real time which > passed from previous frame. Helpers.delay is a variable (not constant). The meaning of this variable is, that at least this much time has to pass,= =20 between two subsequent calls to new_frame_fun. It is in seconds. =46or example the value 0.02 means, that we won't allow more than 50 fps. (I will add this comment to helpers.mli in CVS in moment) |