Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local callbackMod = RegisterMod("CallbackTest", 1)
- debugText = "nothing"
- function callbackMod:gameStarted(isContinued) -- isContinued is a boolean variable that tells us whetever we started the run from a savestate or not
- debugText = "game started" .. tostring(isContinued);
- end
- function callbackMod:gameEnd(isGameOver) -- isGameOver is a boolean variable that tells us whetever we died or ended the game
- debugText = "game end";
- end
- function callbackMod:gameExit(shouldSave) -- shouldSave is a boolean variable that tells us whetever the run should be saved or not (so we can continue it later)
- debugText = "game exit";
- end
- function callbackMod:gameLevel()
- debugText = "level changed";
- end
- function callbackMod:gameRoom()
- debugText = "room changed";
- end
- function callbackMod:debug_text()
- Isaac.RenderText(debugText, 100, 100, 255, 0, 0, 255); -- render debug text
- end
- callbackMod:AddCallback(ModCallbacks.MC_POST_RENDER, callbackMod.debug_text);
- callbackMod:AddCallback(ModCallbacks.MC_POST_GAME_STARTED, callbackMod.gameStarted);
- callbackMod:AddCallback(ModCallbacks.MC_POST_GAME_END, callbackMod.gameEnd);
- callbackMod:AddCallback(ModCallbacks.MC_PRE_GAME_EXIT, callbackMod.gameExit);
- callbackMod:AddCallback(ModCallbacks.MC_POST_NEW_LEVEL, callbackMod.gameLevel);
- callbackMod:AddCallback(ModCallbacks.MC_POST_NEW_ROOM, callbackMod.gameRoom);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement