

Create a file within the same folder as the executable called "nfig" and fill it with the following to enable ui (and mini-game) debugging: Mini-games can be debugged via a Chrome debugger.
#Staxel mods not loading update#
Use this function to update mini-game logic and render to the canvas. Gets called as often as possible (approximately 60 times per second). update() - Called when Staxel is ready to render a frame for the mini-game.Use this function to clean up any resources. stop() - Called during a call to exit().Use this to initialise any required state. start() - Called when the game is ready to start.Return "pixelated" for pixelated rendering, or an empty string to default rendering. renderingType() - Called before the call to start().The following members must be defined (or may be optional): Also called automatically if the mini-game needs to be closed externally. exit() - Call this function if you would like to close the mini-game.Returns a future Object that can be used to get the resulting translations. getTranslations(codes) - Loads translations from the Staxel Client specified by their codes from codes (String Array).Returns a future Object that can be used to get the resulting image. width and height specify the size of the image. loadImage(imagePath, width, height) - Loads an image from disk specified by imagePath (String), or from the cache if available.playSound(soundCode) - Plays a sound specified by soundCode (String).defaultFontSize - The current font size in use by the current language.Defaults to "Arial" if no font is currently in use. defaultFont - The current font name in use by the current language.canvas - The canvas element used to render to.The following members are initialised automatically and can be used immediately: Additionally, if an icon was specified, an image should be added as well.Īll API functions are called from an object that must be named MiniGameHandler. In this example, the file should be called "myMiniGame.js" inside the "mods/myMod" folder.
#Staxel mods not loading Patch#
Once the patch file is created the game itself can be added to the source file mentioned in "gameSource" above. the miniGamesList from nfig will be merged with our one here "file": "nfig", // name of the file to "patch"

patch file with contents similar to the following: To add your own mini-game without modifying nfig (recommended for public mods), first, create a. png image that will be displayed in the mini-game selection list.
#Staxel mods not loading code#
js file containing the source code for the mini-game. code - The code used to refer to a particular mini-game.All mini-games are referenced through the nfig file located in the root content folder.
