Last active
March 1, 2019 11:05
-
-
Save heestand-xyz/40ff873aa859228d902c37f02ee94258 to your computer and use it in GitHub Desktop.
Pixels - City
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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