我想添加一個矩形,其中包含用戶第一次觸摸的角落以及用戶擡起的另一個角落。我還想在用戶拖動手指時顯示矩形。 override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
for touch in touches{
let position1 = touch.location(in: sel
我下面這個教程(我認爲這是用JavaScript編寫):3D Terrain 我試着它斯威夫特與SpriteKit但必須與x軸的旋轉問題。 所以這是它看起來像在教程: 而這正是我現在: 我創造了這個網格下面的代碼: var shapePoints = [CGPoint]()
for i in 0...zeilen+1{
for j in 0...spalten{
shape