Game Maker Language リファレンス > 組み込み関数 用途別 > リソース操作・オブジェクト > event_number
event_number;
real
This read-only variable returns the number of the event currently being called, where the number is actually referring to the "sub event" of the event, ie: for the step event the event number could be any one of the constants ev_step_normal, ev_step_begin, or ev_step_end. For a full list of constants that are available for the specific sub-events see event_perform?, and if you should need to know the main event itself, you should be checking the event_type
switch (event_number) { case ev_step_normal: show_debug_message("Step event!"); break; case ev_game_start: show_debug_message("Game Start""); break; case ev_room_start: show_debug_message("Room Start!"); break; }
上記のコードは、スクリプト形式と呼ばれ、イベントが現在トリガされる通知するデバッグメッセージを表示するために使用することができる。 原文:The above code could be called form a script and used to show debug messages informing you which event is being currently triggered.