package ocgtk

  1. Overview
  2. Docs
OCaml bindings for GTK 4

Install

dune-project
 Dependency

Authors

Maintainers

Sources

v0.1-preview2.tar.gz
sha256=4e50fdb5093136a10fc8ffbe388e44cbcb70d52f8afdd48863ec7e22580ff054

doc/ocgtk.graphene/Ocgtk_graphene/Graphene/Wrappers/Point/index.html

Module Wrappers.Point

type t = [ `point ] Gobject.obj

A point with two coordinates.

val alloc : unit -> t

Create a new Point

val to_vec2 : t -> [ `vec2 ] Gobject.obj

Stores the coordinates of the given #graphene_point_t into a #graphene_vec2_t.

val near : t -> t -> float -> bool

Checks whether the two points @a and @b are within the threshold of @epsilon.

val interpolate : t -> t -> float -> t

Linearly interpolates the coordinates of @a and @b using the given @factor.

val init_from_vec2 : t -> [ `vec2 ] Gobject.obj -> t

Initializes @p with the coordinates inside the given #graphene_vec2_t.

val init_from_point : t -> t -> t

Initializes @p with the same coordinates of @src.

val init : t -> float -> float -> t

Initializes @p to the given @x and @y coordinates.

It's safe to call this function multiple times.

val equal : t -> t -> bool

Checks if the two points @a and @b point to the same coordinates.

This function accounts for floating point fluctuations; if you want to control the fuzziness of the match, you can use graphene_point_near() instead.

val distance : t -> t -> float * float * float

Computes the distance between @a and @b.

val get_type : unit -> Gobject.Type.t