Table of Contents
Customers should update their Python scripts based on the below changes:
Keyboard, mouse button, and joystick button event information is
now encapsulated within the PyKeyEvent class.
Python scripts will need to be updated in the following
locations:
-
The personality script event handler
handleKeyEventnow takes a single parameter, which is aPyKeyEventinstance. -
GUI.handleKeyEventnow takes a single parameter, which should be aPyKeyEventinstance. -
The
handleKeyEventandhandleMouseButtonEventmethods onSimpleGUIComponentscripts need to be adjusted in the same way so that they take a singlePyKeyEventparameter. -
BaseCamera.handleKeyEventnow takes aPyKeyEvent.
See the Client Python API for details on the
PyKeyEvent class.
Mouse movement events are now encapsulated within the
PyMouseEvent class. Python scripts will need to
be updated in the following locations:
-
The personality script event handler
handleMouseEventnow takes a single parameter, which is aPyMouseEventinstance. -
GUI.handleMouseEventnow takes a single parameter, which should be aPyMouseEventinstance. -
The
handleMouseEventmethods onSimpleGUIComponentscripts need to be adjusted in the same way so that they take aPyKeyEventrather than passing deltas as individual parameters. -
BaseCamera.handleMouseEventnow takes aPyMouseEvent.
See the Python Client API documentation for details on the
PyMouseEvent class.
Joystick axis events are now encapsulated within the
PyAxisEvent class. Python scripts will need to be
updated in the following locations:
-
The personality script event handler
handleAxisEventnow takes a single parameter, which is aPyAxisEventinstance. -
GUI.handleAxisEventnow takes a single parameter, which should be aPyAxisEventinstance. -
The
handleMouseEventmethods onSimpleGUIComponentscripts need to be adjusted in the same way so that they take aPyKeyEventrather than passing deltas as individual parameters. -
BaseCamera.handleAxisEventnow takes aPyAxisEvent.
See the Python Client API documentation for details on the
PyAxisEvent class.
handleCharEvent has been removed as
character events are now included as part of the
PyKeyEvent class. Any character input logic needs
to be moved to handleKeyEvent by checking to
see if the character member of
PyKeyEvent is None or a valid
Unicode string.
The SimpleGUIComponent.mouseButtonFocus now
controls a number of events related to the mouse which was previously
controlled by the SimpleGUIComponent.focus property.
These are:
-
SimpleGUIComponent.handleMouseButtonEvent -
SimpleGUIComponent.handleClickEvent
In order for these events to be called on the component scripts,
be sure to set the mouseButtonFocus attribute to
True, either via the scripts or within the .gui XML files.
The
SimpleGUIComponent.handleMouseButtonEvent will
now only be called on one component, which is the top most component
located beneath the mouse that has mouseButtonFocus
set to True.
Previously, mouseButtonFocus would be called on
the top most component as well as each other component that the mouse is
under (whether or not it was hidden by another overlapping
component).
Note
Keep in mind that handleKeyEvent will
still be called for mouse buttons (i.e. it is treated as if it is any
other key button press), as it did in previous versions (as long as
handleMouseButtonEvent returns
False).
Previously, the interpretation of a pitch value was inconsistent throughout the BigWorld API. This has now been made consistent. A positive pitch is now consistently interpreted as nose pointing down and a negative pitch as nose pointing up. This has affected a number of APIs.
The meaning of minPitch and maxPitch have been swapped. minPitch is now the most that the pitch can point upwards and maxPitch is the most that the pitch can point downwards.
If the direction cursor setting are read out of
engine_config.xml, the pitch related settings in
the directionCursor section may need to be updated.
If the pitch of the cursor camera is now queried, it will now be the inverse of what it used to be.
