CharacterControllerSection.qml 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. // Copyright (C) 2023 The Qt Company Ltd.
  2. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
  3. import QtQuick 2.15
  4. import QtQuick.Layouts 1.15
  5. import HelperWidgets 2.0
  6. import StudioTheme 1.0 as StudioTheme
  7. Section {
  8. caption: qsTr("Character Controller")
  9. width: parent.width
  10. SectionLayout {
  11. PropertyLabel {
  12. text: "Gravity"
  13. tooltip: "The gravitational acceleration that applies to the character."
  14. }
  15. SecondColumnLayout {
  16. SpinBox {
  17. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  18. + StudioTheme.Values.actionIndicatorWidth
  19. minimumValue: -9999999
  20. maximumValue: 9999999
  21. decimals: 2
  22. backendValue: backendValues.gravity_x
  23. }
  24. Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
  25. ControlLabel {
  26. text: "X"
  27. color: StudioTheme.Values.theme3DAxisXColor
  28. }
  29. ExpandingSpacer {}
  30. }
  31. PropertyLabel {
  32. }
  33. SecondColumnLayout {
  34. SpinBox {
  35. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  36. + StudioTheme.Values.actionIndicatorWidth
  37. minimumValue: -9999999
  38. maximumValue: 9999999
  39. decimals: 2
  40. backendValue: backendValues.gravity_y
  41. }
  42. Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
  43. ControlLabel {
  44. text: "Y"
  45. color: StudioTheme.Values.theme3DAxisYColor
  46. }
  47. ExpandingSpacer {}
  48. }
  49. PropertyLabel {
  50. }
  51. SecondColumnLayout {
  52. SpinBox {
  53. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  54. + StudioTheme.Values.actionIndicatorWidth
  55. minimumValue: -9999999
  56. maximumValue: 9999999
  57. decimals: 2
  58. backendValue: backendValues.gravity_z
  59. }
  60. Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
  61. ControlLabel {
  62. text: "Z"
  63. color: StudioTheme.Values.theme3DAxisZColor
  64. }
  65. ExpandingSpacer {}
  66. }
  67. PropertyLabel {
  68. text: "Movement"
  69. tooltip: "The controlled motion of the character."
  70. }
  71. SecondColumnLayout {
  72. SpinBox {
  73. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  74. + StudioTheme.Values.actionIndicatorWidth
  75. minimumValue: -9999999
  76. maximumValue: 9999999
  77. decimals: 2
  78. backendValue: backendValues.movement_x
  79. }
  80. Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
  81. ControlLabel {
  82. text: "X"
  83. color: StudioTheme.Values.theme3DAxisXColor
  84. }
  85. ExpandingSpacer {}
  86. }
  87. PropertyLabel {
  88. }
  89. SecondColumnLayout {
  90. SpinBox {
  91. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  92. + StudioTheme.Values.actionIndicatorWidth
  93. minimumValue: -9999999
  94. maximumValue: 9999999
  95. decimals: 2
  96. backendValue: backendValues.movement_y
  97. }
  98. Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
  99. ControlLabel {
  100. text: "Y"
  101. color: StudioTheme.Values.theme3DAxisYColor
  102. }
  103. ExpandingSpacer {}
  104. }
  105. PropertyLabel {
  106. }
  107. SecondColumnLayout {
  108. SpinBox {
  109. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  110. + StudioTheme.Values.actionIndicatorWidth
  111. minimumValue: -9999999
  112. maximumValue: 9999999
  113. decimals: 2
  114. backendValue: backendValues.movement_z
  115. }
  116. Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
  117. ControlLabel {
  118. text: "Z"
  119. color: StudioTheme.Values.theme3DAxisZColor
  120. }
  121. ExpandingSpacer {}
  122. }
  123. PropertyLabel {
  124. text: "Mid Air Control"
  125. tooltip: "Enables movement property to have an effect when the character is in free fall."
  126. }
  127. SecondColumnLayout {
  128. CheckBox {
  129. text: backendValues.midAirControl.valueToString
  130. backendValue: backendValues.midAirControl
  131. implicitWidth: StudioTheme.Values.twoControlColumnWidth
  132. + StudioTheme.Values.actionIndicatorWidth
  133. }
  134. ExpandingSpacer {}
  135. }
  136. PropertyLabel {
  137. text: "Enable ShapeHit Callback"
  138. tooltip: "Enables the shapeHit callback for this character controller."
  139. }
  140. SecondColumnLayout {
  141. CheckBox {
  142. text: backendValues.midAirControl.valueToString
  143. backendValue: backendValues.midAirControl
  144. implicitWidth: StudioTheme.Values.twoControlColumnWidth
  145. + StudioTheme.Values.actionIndicatorWidth
  146. }
  147. ExpandingSpacer {}
  148. }
  149. }
  150. }