Example #1
0
	def _defineUI(self, ui):
		self._uiFields = types.SimpleNamespace()

		element = ControlUIElement()
		element.id = "lhand"
		element.position = Vector2D(ui.center.x, ui.resolution.y - ui.iconSize.y)
		element.AddIcon("lhand_inactive")
		element.RegisterCallback(lambda element=element: self.__uiFieldClicked(element))
		ui.UpdateElement(element)
		self._uiFields.lhand = element

		element = ControlUIElement()
		element.id = "rhand"
		element.position = Vector2D(ui.center.x - ui.iconSize.x, ui.resolution.y - ui.iconSize.y)
		element.AddIcon("rhand_inactive")
		element.RegisterCallback(lambda element=element: self.__uiFieldClicked(element))
		ui.UpdateElement(element)
		self._uiFields.rhand = element

		element = ControlUIElement()
		element.id = "equip"
		element.position = Vector2D(ui.center.x - ui.iconSize.x, ui.resolution.y - ui.iconSize.y * 2)
		element.AddIcon("equip")
		element.RegisterCallback(lambda element=element: self.__uiFieldClicked(element))
		ui.UpdateElement(element)
		self._uiFields.equip = element

		element = ControlUIElement()
		element.id = "swap1"
		element.position = Vector2D(ui.center.x - ui.iconSize.x, ui.resolution.y - ui.iconSize.y * 2)
		element.AddIcon("swap1")
		element.RegisterCallback(lambda element=element: self.__uiFieldClicked(element))
		ui.UpdateElement(element)
		self._uiFields.swap1 = element

		element = ControlUIElement()
		element.id = "swap2"
		element.position = Vector2D(ui.center.x, ui.resolution.y - ui.iconSize.y * 2)
		element.AddIcon("swap2")
		element.RegisterCallback(lambda element=element: self.__uiFieldClicked(element))
		ui.UpdateElement(element)
		self._uiFields.swap2 = element

		element = ControlUIElement()
		element.id = "pocket1"
		element.position = Vector2D(ui.center.x + ui.iconSize.x, ui.resolution.y - ui.iconSize.y)
		element.AddIcon("pocket")
		element.RegisterCallback(lambda element=element: self.__uiFieldClicked(element))
		ui.UpdateElement(element)
		self._uiFields.pocket1 = element

		element = ControlUIElement()
		element.id = "pocket2"
		element.position = Vector2D(ui.center.x + ui.iconSize.x * 2, ui.resolution.y - ui.iconSize.y)
		element.AddIcon("pocket")
		element.RegisterCallback(lambda element=element: self.__uiFieldClicked(element))
		ui.UpdateElement(element)
		self._uiFields.pocket2 = element
Example #2
0
 def position(self) -> Vector2D:
     return Vector2D._FromEngineVec(super().position)
Example #3
0
 def iconSize(self) -> Vector2D:
     return Vector2D._FromEngineVec(self._impl.iconSize)
Example #4
0
 def center(self) -> Vector2D:
     return Vector2D._FromEngineVec(self._impl.center)
Example #5
0
 def resolution(self) -> Vector2D:
     return Vector2D._FromEngineVec(self._impl.resolution)
Example #6
0
 def GetAndDropMoveOrder(self) -> Vector2D:
     return Vector2D._FromEngineVec(self._impl.GetAndDropMoveOrder())
Example #7
0
 def speed(self) -> Vector2D:
     return Vector2D._FromEngineVec(super().speed)