Skip to content
Snippets Groups Projects
Commit 19823115 authored by Sofiane Lasri's avatar Sofiane Lasri
Browse files

Merge remote-tracking branch 'refs/remotes/origin/main'

parents cc39d713 0346dccd
Branches
No related tags found
No related merge requests found
{
"images" : [
{
"filename" : "pngegg.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Pendu/Assets.xcassets/confetti.imageset/pngegg.png

51.1 KiB

......@@ -68,6 +68,7 @@
<pickerView alpha="0.84999999999999998" contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="LNU-nY-Uyk">
<rect key="frame" x="0.0" y="424" width="390" height="162"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<color key="tintColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</pickerView>
<button contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="4Oq-OS-e2C">
<rect key="frame" x="175" y="102" width="188" height="39"/>
......
......@@ -229,6 +229,34 @@ class GameViewController: UIViewController {
V_Button.isHidden = true
B_Button.isHidden = true
N_Button.isHidden = true
let emmitterLayer = CAEmitterLayer()
emmitterLayer.emitterPosition = CGPoint(x: view.bounds.width / 2, y: view.bounds.height / 2)
emmitterLayer.emitterShape = .point
emmitterLayer.emitterMode = .outline
emmitterLayer.emitterSize = CGSize(width: 5, height: 0)
let confetti = CAEmitterCell()
confetti.birthRate = 3
confetti.lifetime = 50
confetti.velocity = 100
confetti.velocityRange = 50
confetti.emissionLongitude = .pi
confetti.spin = 2
confetti.spinRange = 8
confetti.scaleRange = 0.5
confetti.contents = UIImage(named: "confetti.png")?.cgImage
emmitterLayer.emitterCells = [confetti]
view.layer.addSublayer(emmitterLayer)
emmitterLayer.beginTime = CACurrentMediaTime()
DispatchQueue.main.asyncAfter(deadline: .now() + 3) {
emmitterLayer.removeFromSuperlayer()
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment