aboutsummaryrefslogtreecommitdiffstats
path: root/library/capsule.moon
blob: fe546e2ea59b622669c0bddfbda012f16b689e09 (plain)
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
-- let's load a vector library for doing some
-- more interesting transformations

import vec2 from require 'cpml'

=>
  -- let's try to construct a pill-shape
  input.rect @rect
  rect = @rect!
  hsize = (rect.max - rect.min) / 2

  input.circle @left, {
    center: rect.min + vec2 0, hsize.y
    radius: hsize.y
  }
  input.circle @left, {
    center: rect.min + vec2 hsize.x*2, hsize.y
    radius: hsize.y
  }

  -- right, so that's that....
  -- kinda forgetting whether there was something
  -- else I wanted to show.
  -- does this seem interesting to you?
  -- let me know :)