我正在解析svg文件并将其转换为Scenekit def writeAcc():
'''Minigame: User has to enter the correct accusative form, after three correct answers he passed'''
global isPlaying, usedWords
isPlaying = True
# asking the user to enter the right accusative form of the word
print("Please enter the accusative form of the following words\n")
# player passed when he reached 3 correct answers
right = 0
while right < 4:
word, accusative = wordChoice()
print("Nominative ", word)
print("Need help? Enter 'y' to see the menu again or press the enter-key to continue.")
choice = input("\t\t\tChoice: ")
if choice == 'y':
continueGame = displayMenu()
if not continueGame:
return
print("Nominative ", word)
answer=input("Accusative ")
if answer==accusative:
right+=1
print("Guessed right:", right)
if right < 4 and (len(usedWords) == len(list(nom_acc))):
print("Sorry you don't seem to have what it takes to learn the accusative.")
break
if right == 4:
print("Congratulations! You passed the first step, you will now enter the next challenge.")
对象,如果我为svg提供固定的宽度和高度,则效果很好,但如果我的宽度和高度以cm为单位或其他任何值,它都无法正常工作。
SCNNode
那么如何将width,height和viewBox值转换为SceneView值?
谢谢