package raylib

  1. Overview
  2. Docs
OCaml bindings for raylib

Install

dune-project
 Dependency

Authors

Maintainers

Sources

raylib-2.0.0.tbz
sha256=6e86f44506722c89fef8d62a3f2087f7265f90f8c5aaba37edd15644c45d7007
sha512=ece8be2bd9409ba927063f33a73990462b864ee837ae3d87ad8198cd295cf421be7f47114873742877b3262a5c6079e9d6b371f5fe22853bd751576b824c2c07

doc/src/raylib.text/raylib_text.ml.html

Source file raylib_text.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
include Raylib_c_text.Raylib_text_generated.Functions
open Ctypes
open Raylib_core

let load_font_ex filename size = function
  | None -> _load_font_ex filename size None 0
  | Some arr ->
      _load_font_ex filename size (Some (CArray.start arr)) (CArray.length arr)

let load_font_data font_data font_size codepoints codepoint_count ty =
  let count = ptr_of_int 0 in
  let glyphs =
    _load_font_data font_data (String.length font_data) font_size codepoints
      codepoint_count ty count
  in
  CArray.from_ptr glyphs !@count

let measure_text_codepoints font codepoints font_size spacing =
  _measure_text_codepoints font (CArray.start codepoints)
    (CArray.length codepoints) font_size spacing

let draw_text_codepoints font codepoints pos size spacing tint =
  let count = CArray.length codepoints in
  _draw_text_codepoints font (CArray.start codepoints) count pos size spacing
    tint