Skip to content

Instantly share code, notes, and snippets.

@heestand-xyz
Last active March 1, 2019 11:05
Show Gist options
  • Save heestand-xyz/40ff873aa859228d902c37f02ee94258 to your computer and use it in GitHub Desktop.
Save heestand-xyz/40ff873aa859228d902c37f02ee94258 to your computer and use it in GitHub Desktop.
Pixels - City
let imagePix = ImagePIX()
imagePix.image = UIImage(named: "city")!
let resPix = ResPIX(res: .fullscreen)
resPix.fillMode = .aspectFill
resPix.inPix = imagePix
let force: LiveFloat = .touchForce
let finalPix = BlendsPIX.loop(0..<3, with: .add, loop: { i, ix in
let fraction = LiveFloat(i) / LiveFloat(3)
return resPix._move(x: (ix - 0.5) * force * 0.01) * LiveColor(h: fraction)
})
finalPix.view.frame = view.bounds
finalPix.view.fillMode = .aspectFill
view.addSubview(finalPix.view)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment