Joystick position: Difference between revisions

→‎{{header|OCaml}}: handle window resized correctly
(added ocaml)
(→‎{{header|OCaml}}: handle window resized correctly)
Line 120:
 
let position app x y =
let width, heightview = SFRenderWindow.getSizegetView app in
let hwwidth, height = float width /SFView.getSize 2.0view in
let hhhw = float heightwidth /. 2.0 in
let hh = height /. 2.0 in
(hw +. ((x /. 100.0) *. hw),
hh +. ((y /. 100.0) *. hh))