Camera Messages
From TrainzOnline
(Difference between revisions)
m (1 revision) |
Latest revision as of 23:58, 3 February 2010
Camera messages are driver only messages sent when the in game camera focuses on a different object or when the camera viewing mode is changed. Camera messages are always broadcast but the message source varies depending on the message minor.
Variants 1 to 4 are sent by the interface object? and are notifications that the camera mode has changed.
- Camera,Internal-View
- Camera,External-View
- Camera,Tracking-View
- Camera,Roaming-View
- Camera,Interior-Changed is sent by the newly selected cabin? when the focus changes to a new train.
- Camera,Target-Changed is sent by the object which has just acquired camera focus. This is usually, but not always, a train.
Camera,Target-Changed can be used to keep track of the train in focus by checking that msg.src is a train and assigning it to a variable in your script. To avoid every instance of your script tracking the same data you can use a static class or a script library to hold the information.
The World class contains methods for reading and controlling the camera.