選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

38 行
718B

  1. import arcade
  2. from cld import *
  3. # Convert String config value to Bool or Float if possible
  4. def desktop_aux_convertValue(
  5. value: str
  6. ) -> any:
  7. # Bool.
  8. if (
  9. value == "false"
  10. ):
  11. return False
  12. elif (
  13. value == "true"
  14. ):
  15. return True
  16. # Float.
  17. elif (
  18. cld_isdigit(value)
  19. ):
  20. return float(value)
  21. # String.
  22. return value
  23. # Load texture
  24. def desktop_aux_loadTexture(
  25. resDir: str,
  26. desc: dict[str, str]
  27. ):
  28. path = resDir + "/" + desc["file"]
  29. return arcade.load_texture(
  30. path,
  31. x = float(desc["x"]),
  32. y = float(desc["y"]),
  33. width = float(desc["width"]),
  34. height = float(desc["height"])
  35. )