安装 Steam
登录
|
语言
繁體中文(繁体中文)
日本語(日语)
한국어(韩语)
ไทย(泰语)
български(保加利亚语)
Čeština(捷克语)
Dansk(丹麦语)
Deutsch(德语)
English(英语)
Español-España(西班牙语 - 西班牙)
Español - Latinoamérica(西班牙语 - 拉丁美洲)
Ελληνικά(希腊语)
Français(法语)
Italiano(意大利语)
Bahasa Indonesia(印度尼西亚语)
Magyar(匈牙利语)
Nederlands(荷兰语)
Norsk(挪威语)
Polski(波兰语)
Português(葡萄牙语 - 葡萄牙)
Português-Brasil(葡萄牙语 - 巴西)
Română(罗马尼亚语)
Русский(俄语)
Suomi(芬兰语)
Svenska(瑞典语)
Türkçe(土耳其语)
Tiếng Việt(越南语)
Українська(乌克兰语)
报告翻译问题




An event is created, many of these are created in the engine (game.events[]) but you can also create your own from within python using the Event class.
Event listeners and their handlers are assigned. These are functions which will be called whenever the event is invoked. Note that handlers (aka the functions called by an event) can take arguments. Normally this is done during registration.py
Events are invoked. This triggers all handlers listening to a single event and give them the variable passed (assuming they accept variables). Off the top of my head I think you can only pass one variable when invoking events, but just use a tuple to get around that. Events are invoked all throughout the code depending on the circumstance.
Event listeners are removed. Some events will naturally be destroyed in this case this isn't needed but others would persist between game sessions (for example, if you load a game, close it, then load another without ever closing the game itself). In this case we have to set some events to remove their listeners when closing out the game.
Hope this helps you understand how events work. The execution order of events has to do with when the event is invoked.