type t
The type of pre-rendered customised texts.
This module provides a more customisable way to render text through the use of iterators. This might prove more costly and also harder to use than the simple Text.t but it is much more powerful.
type t
type ('a,'b) it = 'a -> 'b -> ('b -> 'b) -> 'b
'a
is the type of objects that we manipulate (eg. Font.code
) while 'b
is the type of the value computed by the iterator. We rely here on continuation passing style to deal with this vaue at each step.
type ('a,'b,'c) full_it = (('a, 'b) it * 'b * 'b -> 'c)
val forall : 'c -> ('a, 'c list, 'c list) full_it
val foreach : ('a -> 'b) -> ('a, 'b list, 'b list) full_it
val foreachi : ('a -> int -> 'b) -> ('a, ('b list * int), 'b list) full_it
val foreachword : (Font.code list -> 'a) -> 'a -> (Font.code, ('a list * Font.code list), 'a list) full_it
val create : (module RenderTarget.T with type t = 'a) -> target:'a -> text:string -> position:OgamlMath.Vector2f.t -> font:Font.t -> colors:(Font.code, 'b, Color.t list) full_it -> size:int -> unit -> t
val draw : (module RenderTarget.T with type t = 'a) -> ?parameters:DrawParameter.t -> text:t -> target:'a -> unit -> unit
val advance : t -> OgamlMath.Vector2f.t
val boundaries : t -> OgamlMath.FloatRect.t