Phaser 4 examples

Plugins

  • 17 examples

Examples 17

Creating a Global PluginThis example demonstrates how to create a custom global plugin, register it in the game configuration, and access its methods from within a scene.Custom Game Object via PluginDemonstrates how to register a custom Game Object class as a plugin so it can be added to a scene using a custom method on the Scene Factory (this.add).Custom Loader File TypeDemonstrates how to extend the Phaser Loader by registering a custom file type through a plugin, including processing the loaded data before it enters the cache.Custom Scene PluginDemonstrates how to create, register, and use a custom Scene Plugin to extend Scene functionality with reusable logic.Custom Scene PluginDemonstrates how to create and register a custom Scene Plugin that maps to a specific property on the Scene, used here to generate a procedural fractal via a Canvas texture.Destroying a Game Instance with PluginsDemonstrates how to completely destroy a Phaser game instance that uses a custom plugin and then safely recreate it from scratch.Global Plugin from ClassDemonstrates how to define a custom class extending BasePlugin, register it globally via the Loader, and access its functionality from within a Scene.Global Scene PluginDemonstrates how to register a global plugin in the game configuration and access its methods within a Scene using a custom property mapping.Install Global Plugin At RuntimeDemonstrates how to dynamically register and instantiate custom global plugins using the Plugin Manager after the game has started.Loading a Scene PluginDemonstrates how to load an external Scene-level plugin during the preload phase and access its functionality via a custom property on the Scene.Loading a Scene PluginDemonstrates how to dynamically load a Scene Plugin and use its injected property to create and animate specialized content within a Scene.Loading External PluginsThis example demonstrates how to load an external JavaScript plugin file during the preload phase and access its custom methods within a Scene.Multiple Global Plugin InstancesDemonstrates how to start and manage multiple independent instances of the same global plugin class using the Plugin Manager, allowing for separate configurations and states.Rendering FIGlet Fonts with SpritesDemonstrates how to manually parse a FIGlet (.flf) font file and render text by positioning sprites based on the ASCII character data.Scene Plugin Dynamic Fractal CanvasDemonstrates how to create a custom Scene Plugin that renders an animated Julia set fractal onto a dynamic canvas texture. The example shows how to map the plugin to a Scene property and animate its internal variables using tweens.Scene Plugin LoaderDemonstrates how to dynamically load an external Scene Plugin and access its functionality via a custom property on the Scene.Start and Stop a PluginDemonstrates how to create a global plugin and dynamically toggle its execution at runtime using the Plugin Manager's start and stop methods.