fast quadratic exit feels better
This commit is contained in:
		| @@ -156,14 +156,14 @@ end | ||||
| -- rearm pane objects | ||||
| easing_pane = mknew{ | ||||
|  -- to enter: pos = -1; to exit: pos = 1 | ||||
|  -- runs for 16 frames | ||||
|  -- runs for 16 frames in, 8 frames out | ||||
| } | ||||
|  | ||||
| function easing_pane:frac() | ||||
|  local pos = self.pos | ||||
|  if (not pos) return | ||||
|  if (pos < 0) return 1-easeoutbounce(1+pos) | ||||
|  if (pos > 0) return easeoutbounce(1-pos) | ||||
|  if (pos > 0) return (1-pos)*(1-pos) | ||||
|  return 0 | ||||
| end | ||||
|  | ||||
| @@ -173,7 +173,7 @@ function easing_pane:update() | ||||
|  -- increment is 0x0.1 -- 1/16th of pos | ||||
|  if (pos < 0) pos = min(pos + 0x0.1, 0) | ||||
|  if pos > 0 then | ||||
|   pos -= 0x0.1 | ||||
|   pos -= 0x0.2 | ||||
|   if (pos <= 0) pos = nil | ||||
|  end | ||||
|  self.pos = pos | ||||
|   | ||||
		Reference in New Issue
	
	Block a user