SWIFTUI-Text Modifierでスターウォーズ効果を実現
import SwiftUI
struct ContentView: View {
var body: some View {
Text("""
The dead speak! The galaxy has heard a mysterious broadcast, a threat of REVENGE in the sinister voice of the late EMPEROR PALPATINE.
GENERAL LEIA ORGANA dispatches secret agents to gather intelligence, while REY, the last hope of the Jedi, trains for battle against the diabolical FIRST ORDER.
Meanwhile, Supreme Leader KYLO REN rages in search of the phantom Emperor, determined to destroy any threat to his power....
""")
.font(.system(.title))
.fontWeight(.black)
.foregroundColor(.yellow)
.background(Color.black)
.lineLimit(10)
.multilineTextAlignment(.center)
.truncationMode(.head)
.lineSpacing(10.0)
.padding()
.rotation3DEffect(
.degrees(45),
axis: (x: 1.0, y: 0.0, z: 0.0)
)
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
Reference
この問題について(SWIFTUI-Text Modifierでスターウォーズ効果を実現), 我々は、より多くの情報をここで見つけました https://velog.io/@sionkim00/SwiftUI-Text-Modifier을-이용하여-스타워즈-효과テキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol