### Install and Run MCP Server Source: https://github.com/phaserjs/editor-mcp-server/blob/main/README.md This snippet shows how to configure an MCP host, like Cursor, to use the Phaser Editor MCP server. It specifies the command to run and the package name. ```json { "mcpServers": { "phaser-editor": { "command": "npx", "args": ["@phaserjs/editor-mcp-server"] } } } ``` -------------------------------- ### Get Spritesheet Image Source: https://github.com/phaserjs/editor-mcp-server/blob/main/README.md Fetches the PNG image file for a given spritesheet asset. This allows access to the spritesheet's visual data. ```bash npx @phaserjs/editor-mcp-server assets-get-spritesheet-image --spritesheet ``` -------------------------------- ### Get Spine Skeleton Info Source: https://github.com/phaserjs/editor-mcp-server/blob/main/README.md Fetches detailed information about a Spine skeleton, including its available animations and skins. This aids in understanding and utilizing complex animations. ```bash npx @phaserjs/editor-mcp-server assets-get-spine-skeleton-info --skeleton ``` -------------------------------- ### Get Active Scene Source: https://github.com/phaserjs/editor-mcp-server/blob/main/README.md Fetches information about the currently focused scene in the Phaser Editor. This helps in identifying the active context for further operations. ```bash npx @phaserjs/editor-mcp-server ide-get-active-scene ``` -------------------------------- ### Get Tilemap Data Source: https://github.com/phaserjs/editor-mcp-server/blob/main/README.md Fetches the data content of a specified Tiled tilemap file. This allows for programmatic access to level layouts and object data. ```bash npx @phaserjs/editor-mcp-server assets-get-tilemap-data --tilemap ``` -------------------------------- ### Get Phaser Scene Data Source: https://github.com/phaserjs/editor-mcp-server/blob/main/README.md Retrieves all objects within the current scene, including their properties and configurations. This data can be used for serialization or analysis. ```javascript const sceneData = editor.scene.getSceneData(); console.log('Scene data:', sceneData); ``` -------------------------------- ### Get Spine Skin Image Source: https://github.com/phaserjs/editor-mcp-server/blob/main/README.md Retrieves the PNG image data for a specific skin of a Spine skeleton. This allows for visual inspection or manipulation of different character appearances. ```bash npx @phaserjs/editor-mcp-server assets-get-spine-skin-image --skeleton --skin ``` -------------------------------- ### Get Texture Binary Data Source: https://github.com/phaserjs/editor-mcp-server/blob/main/README.md Fetches the raw binary data for a specified texture asset. This can be used for custom processing or analysis of image files. ```bash npx @phaserjs/editor-mcp-server assets-get-texture-binary --texture ``` -------------------------------- ### Get Texture Content Bounding Box Source: https://github.com/phaserjs/editor-mcp-server/blob/main/README.md Calculates and returns the bounding box coordinates for the content within a specified texture. This is helpful for precise asset placement and interaction. ```bash npx @phaserjs/editor-mcp-server assets-get-texture-content-bounding-box --texture ``` -------------------------------- ### Get Phaser Scene Screenshot Source: https://github.com/phaserjs/editor-mcp-server/blob/main/README.md Captures a screenshot of the current scene in Phaser Editor. The screenshot can be saved or processed further. ```javascript editor.scene.getScreenshot(); ``` -------------------------------- ### Get Bitmap Font Image Source: https://github.com/phaserjs/editor-mcp-server/blob/main/README.md Retrieves the PNG image file associated with a specific bitmap font. This is useful for inspecting or using the font's visual representation. ```bash npx @phaserjs/editor-mcp-server assets-get-bitmapfont-image --font ``` -------------------------------- ### Get Editable Tilemap Layer Selection Source: https://github.com/phaserjs/editor-mcp-server/blob/main/README.md Retrieves the tile data for a selected region within an editable tilemap layer, returning it as a 2D array. ```javascript const selectedTiles = editor.scene.getEditableTilemapLayerSelectionData(layer, x, y, width, height); console.log('Selected tile data:', selectedTiles); ``` -------------------------------- ### Get Overlap Amounts Source: https://github.com/phaserjs/editor-mcp-server/blob/main/src/system-prompt.md Retrieves the overlap amounts on the X and Y axes, and for rotation (R), if this physics body is currently colliding with another. ```typescript body.overlapX: number = 0 body.overlapY: number = 0 body.overlapR: number = 0 ``` -------------------------------- ### Get Phaser Scene Dimensions Source: https://github.com/phaserjs/editor-mcp-server/blob/main/README.md Retrieves the dimensions (width and height) of the current scene in Phaser Editor. This is useful for layout and rendering calculations. ```javascript const dimensions = editor.scene.getSceneDimension(); console.log(`Scene dimensions: ${dimensions.width}x${dimensions.height}`); ``` -------------------------------- ### List Available Animations Source: https://github.com/phaserjs/editor-mcp-server/blob/main/README.md Provides a list of all sprite animation configurations defined in the project. This is essential for managing character or object animations. ```bash npx @phaserjs/editor-mcp-server assets-get-available-animations ``` -------------------------------- ### List Available Tilemaps Source: https://github.com/phaserjs/editor-mcp-server/blob/main/README.md Provides a list of all Tiled tilemap files included in the project. This is essential for working with map-based game levels. ```bash npx @phaserjs/editor-mcp-server assets-get-available-tilemaps ``` -------------------------------- ### List All Scenes in Project Source: https://github.com/phaserjs/editor-mcp-server/blob/main/README.md Retrieves a list of all scene files within the current Phaser Editor project. This is useful for understanding the project structure and managing scenes. ```bash npx @phaserjs/editor-mcp-server ide-get-all-scenes-in-project ``` -------------------------------- ### Create New Scene File Source: https://github.com/phaserjs/editor-mcp-server/blob/main/README.md Generates a new, empty scene file in the Phaser Editor project. This is a foundational step for creating new game levels or components. ```bash npx @phaserjs/editor-mcp-server ide-create-new-scene --name ``` -------------------------------- ### List Available Bitmap Fonts Source: https://github.com/phaserjs/editor-mcp-server/blob/main/README.md Returns a list of all bitmap font assets configured in the project. This helps in managing and utilizing custom fonts. ```bash npx @phaserjs/editor-mcp-server assets-get-available-bitmapfonts ``` -------------------------------- ### Configure Editor Preview Properties Source: https://github.com/phaserjs/editor-mcp-server/blob/main/src/system-prompt.md Settings for previewing the emitter within the editor, including advancing the preview time and activating the preview. ```javascript previewAdvance: number previewActive: boolean ``` -------------------------------- ### List Available Textures Source: https://github.com/phaserjs/editor-mcp-server/blob/main/README.md Retrieves a list of all texture assets available in the Phaser Editor project. This is useful for managing and referencing image assets. ```bash npx @phaserjs/editor-mcp-server assets-get-available-textures ``` -------------------------------- ### List Available Spine Atlases Source: https://github.com/phaserjs/editor-mcp-server/blob/main/README.md Returns a list of all Spine atlas assets available in the project. Atlases are used to group textures for Spine animations. ```bash npx @phaserjs/editor-mcp-server assets-get-available-spine-atlases ``` -------------------------------- ### Tilemap Class Structure Source: https://github.com/phaserjs/editor-mcp-server/blob/main/src/system-prompt.md Represents a Tilemap, holding its key and an array of associated Tileset configurations. The constructor initializes the tilemap with a key and its tilesets. ```javascript class Tilemap extends PlainObject { constructor(key, tilesets) key: string tilesets: TilesetConfig[] } ``` -------------------------------- ### List Available Spine Skeletons Source: https://github.com/phaserjs/editor-mcp-server/blob/main/README.md Retrieves a list of all Spine skeleton assets used in the project. This is crucial for working with skeletal animations. ```bash npx @phaserjs/editor-mcp-server assets-get-available-spine-skeletons ``` -------------------------------- ### PrefabComponent Properties Source: https://github.com/phaserjs/editor-mcp-server/blob/main/src/system-prompt.md Handles prefab instantiation and customization. It includes `prefabId` to link to a prefab scene, `unlock` to specify modifiable properties in the instance, and `prefabProps` to set custom values for prefab properties. ```TypeScript class PrefabComponent { prefabId: string unlock: string[] prefabProps: { [key: string]: any } } ``` -------------------------------- ### BitmapText Component Source: https://github.com/phaserjs/editor-mcp-server/blob/main/src/system-prompt.md Defines a BitmapText object, which uses bitmap fonts for rendering text. It extends GameObject and includes components for transformation, visibility, alpha, blend mode, and tinting, with properties for font, alignment, and shadow. ```JavaScript class BitmapText extends GameObject, TransformComponent, OriginComponent, VisibleComponent, AlphaComponent, BlendModeComponent, TintComponent { constructor(x, y, font, fontSize, text) text: string // Bitmap Font asset key. font: string // 0 left, 1 center, 2 right align: number = 0 fontSize: number letterSpacing: number maxWidth: number dropShadowX: number dropShadowY: number dropShadowAlpha: number // shadow color in hex format (e.g., "#ff0000" for red) dropShadowColor: string } ``` -------------------------------- ### Configure Particle Timing Properties Source: https://github.com/phaserjs/editor-mcp-server/blob/main/src/system-prompt.md Manages the timing aspects of particle emission and updates, including delay, hold time, lifespan, emission rate, duration, and timescale. ```javascript delay: EmitterOp_onEmitOnly hold: EmitterOp_onEmitOnly lifespan: EmitterOp_onEmitOnly quantity: EmitterOp_onEmitOnly _duration: number _stopAfter: number _frequency: number _timeScale: number _maxAliveParticles: number _maxParticles: number _advance: number ``` -------------------------------- ### Phaser Editor MCP Server - Bokeh Filter Source: https://github.com/phaserjs/editor-mcp-server/blob/main/src/system-prompt.md Introduces a 'Bokeh' filter for creating depth-of-field effects. Configurable parameters include radius, amount (strength), contrast, and a boolean to switch between standard bokeh and tilt-shift effects. ```typescript class Bokeh extends Filter { // The radius of the bokeh effect. This is a float value, where a radius of 0 will result in no effect being applied, and a radius of 1 will result in a strong bokeh. However, you can exceed this value for even stronger effects. radius: number = 0.5 // The amount, or strength, of the bokeh effect. amount: number = 1 // The color contrast, or brightness, of the bokeh effect. contrast: number = 0.2 // Is this a Tilt Shift effect or a standard bokeh effect? } ``` -------------------------------- ### Open Scene in Editor Source: https://github.com/phaserjs/editor-mcp-server/blob/main/README.md Opens a specified scene file within the Phaser Editor application. This command allows programmatic control over which scene is active. ```bash npx @phaserjs/editor-mcp-server ide-open-scene --scene ``` -------------------------------- ### Phaser Editor MCP Server - Particle Emitter Configuration Source: https://github.com/phaserjs/editor-mcp-server/blob/main/src/system-prompt.md Defines the `ParticleEmitter` class and its configuration properties for Phaser Editor's MCP Server. This includes transform, origin, visibility, alpha, and blend mode components, along with specific particle emission properties. ```typescript class ParticleEmitter extends GameObject, TransformComponent, OriginComponent, VisibleComponent, AlphaSingleComponent, BlendModeComponent { constructor(label) // The configuration object for the Particle Emitter. This contains all the properties that can be set on the emitter. config: { // Transform properties // The x coordinate the particles are emitted from. This is relative to the Emitters x coordinate and that of any parent. x: EmitterOp_onEmitAndUpdate // The y coordinate the particles are emitted from. This is relative to the Emitters y coordinate and that of any parent. y: EmitterOp_onEmitAndUpdate // The x coordinate emitted particles move toward. moveToX: EmitterOp_onEmitAndUpdate // The y coordinate emitted particles move toward. moveToY: EmitterOp_onEmitAndUpdate } } ``` -------------------------------- ### Add Multiple Phaser Game Objects Source: https://github.com/phaserjs/editor-mcp-server/blob/main/README.md Adds multiple new game objects to the scene at once. Requires an array of object configurations. ```javascript editor.scene.addGameObjects(newGameObjects); ``` -------------------------------- ### Tileset Configuration Structure Source: https://github.com/phaserjs/editor-mcp-server/blob/main/src/system-prompt.md Defines the structure for a tileset configuration, including its name and the key of the associated image or spritesheet asset. ```javascript class TilesetConfig { name: string imageKey: string } ``` -------------------------------- ### Configure Particle Color and Appearance Source: https://github.com/phaserjs/editor-mcp-server/blob/main/src/system-prompt.md Manages the color tint, alpha transparency, color interpolation, tint fill mode, and blend mode for emitted particles. ```javascript tint: EmitterOp_onEmitAndUpdate alpha: EmitterOp_onEmitAndUpdate color: EmitterOp_None | EmitterOp_Random colorEase: EaseType tintFill: boolean blendMode: BlendModes ``` -------------------------------- ### Arcade Physics Component Configuration Source: https://github.com/phaserjs/editor-mcp-server/blob/main/src/system-prompt.md Manages the Arcade Physics properties of a Game Object, including activation status, body type, geometry, and radius for circular bodies. Activation is read-only and managed via specific tools. ```TypeScript class ArcadeComponent { // Whether the arcade component is active or not. When the Arcade component is active it means the game object has a Phaser Arcade Physics body. To enable a physics body, use the scene-enable-arcade-physics-body tool. To disable a physics body, use the scene-disable-arcade-physics-body tool. This property is readonly and cannot be set directly. readonly ArcadeComponent.active: boolean = false // The type of physics body to create for the Arcade Physics component. DYNAMIC_BODY (0) is a body that can move and be affected by forces, STATIC_BODY (1) is a body that does not move and is not affected by forces. body.physicsType: number = 0 // The geometry of the physics body to create for the Arcade Physics component. CIRCLE (0) is a circular body, RECTANGLE (1) is a rectangular body. body.geometry: number = 1 // If this Body is circular, this is the unscaled radius of the Body, as set by setCircle(), in source pixels. The true radius is equal to `halfWidth`. body.radius: number = 0 } ``` -------------------------------- ### Text Component Source: https://github.com/phaserjs/editor-mcp-server/blob/main/src/system-prompt.md Represents a Text object with extensive styling options. It extends GameObject and includes components for transformation, visibility, alpha, blend mode, and tinting, with properties for font, color, and shadow. ```JavaScript class Text extends GameObject, TransformComponent, OriginComponent, FlipComponent, VisibleComponent, AlphaComponent, BlendModeComponent, TintComponent { constructor(x, y, text) text: string fontFamily: string fontSize: string align: "left" | "center" | "right" | "justify" fontStyle: " " | "bold" | "italic" | "bold italic" stroke: string strokeThickness: number color: string backgroundColor: string shadow: { offsetX: number = 0 offsetY: number = 0 color: string = "#000" stroke: boolean = false fill: boolean = false blur: number = false } } ``` -------------------------------- ### PlainObject Class Source: https://github.com/phaserjs/editor-mcp-server/blob/main/src/system-prompt.md Represents a basic object that cannot be used for prefabs or nested prefabs. It serves as a base class for more complex components. ```javascript class PlainObject extends VariableComponent { constructor(label) } ``` -------------------------------- ### Pack Phaser Objects in Container Source: https://github.com/phaserjs/editor-mcp-server/blob/main/README.md Groups multiple game objects into a container, simplifying their management and manipulation as a single unit. ```javascript editor.scene.packObjectsInContainer(objectsToPack, container); ``` -------------------------------- ### Size Component Configuration Source: https://github.com/phaserjs/editor-mcp-server/blob/main/src/system-prompt.md Defines the width and height of a Game Object. Defaults to zero for both dimensions. ```TypeScript class SizeComponent { width: number = 0 height: number = 0 } ``` -------------------------------- ### Single Alpha Component Configuration Source: https://github.com/phaserjs/editor-mcp-server/blob/main/src/system-prompt.md A simplified component for setting a uniform alpha value across the entire Game Object. Defaults to fully opaque. ```TypeScript class AlphaSingleComponent { alpha: number = 1 } ``` -------------------------------- ### Configure Particle Sorting Properties Source: https://github.com/phaserjs/editor-mcp-server/blob/main/src/system-prompt.md Defines how particles are sorted for rendering, including bringing new particles to the top, sorting order, and the property to sort by. ```javascript particleBringToTop: boolean sortOrderAsc: boolean sortProperty: string ``` -------------------------------- ### Add Multiple Phaser Plain Objects Source: https://github.com/phaserjs/editor-mcp-server/blob/main/README.md Adds multiple new plain objects to the scene. Useful for batch creation of custom data structures. ```javascript editor.scene.addPlainObjects(newPlainObjects); ``` -------------------------------- ### Phaser Editor MCP Server - Blur Filter Source: https://github.com/phaserjs/editor-mcp-server/blob/main/src/system-prompt.md Offers a 'Blur' filter with adjustable parameters. This includes horizontal and vertical offsets, blur strength, color, and the number of steps for the blur effect, impacting smoothness and performance. ```typescript class Blur extends Filter { // The horizontal offset of the blur effect. x: number = 2 // The vertical offset of the blur effect. y: number = 2 // The strength of the blur effect. strength: number = 1 // The color of the blur as a hex string. color: string = "#ffffff" // The number of steps to run the Blur effect for. This value should always be an integer. The higher the value, the smoother the blur, but at the cost of exponentially more gl operations. Keep this to the lowest possible number you can have it, while still looking correct for your game. steps: number = 4 } ``` -------------------------------- ### Configure Particle Physics Properties Source: https://github.com/phaserjs/editor-mcp-server/blob/main/src/system-prompt.md Controls the physics behavior of emitted particles, including acceleration, maximum velocity, initial speed, and gravity. ```javascript accelerationX: EmitterOp_onEmitAndUpdate accelerationY: EmitterOp_onEmitAndUpdate maxVelocityX: EmitterOp_onEmitAndUpdate maxVelocityY: EmitterOp_onEmitAndUpdate speed: EmitterOp_onEmitOnly speedX: EmitterOp_onEmitOnly speedY: EmitterOp_onEmitOnly gravityX: number gravityY: number radial: boolean ``` -------------------------------- ### Tint Component Configuration Source: https://github.com/phaserjs/editor-mcp-server/blob/main/src/system-prompt.md Manages the tinting of a Game Object, including fill behavior and per-corner tint colors. Tint colors are specified in hexadecimal format. The default tint is white, with no fill. ```TypeScript // Tint color fields are in hexadecimal format, e.g., "#ff0000" for red. // This value is interpolated from the corner to the center of the game object. class TintComponent { // Tint fill. false = An additive tint (the default), where vertices colors are blended with the texture. true = A fill tint, where the vertices colors replace the texture, but respects texture alpha. It is not required to set the corner tints. tintFill: boolean = false tintTopLeft: string = "#ffffff" tintTopRight: string = "#ffffff" tintBottomLeft: string = "#ffffff" tintBottomRight: string = "#ffffff" } ``` -------------------------------- ### Visible Component Configuration Source: https://github.com/phaserjs/editor-mcp-server/blob/main/src/system-prompt.md Controls the visibility of a Game Object. The default state is visible. ```TypeScript class VisibleComponent { visible: boolean = true } ``` -------------------------------- ### Origin Component Configuration Source: https://github.com/phaserjs/editor-mcp-server/blob/main/src/system-prompt.md Defines the origin point for a Game Object, influencing how its size and position are related. The default is the center (0.5), but it can be set to the left edge (0). ```TypeScript class OriginComponent { originX: number = 0.5 originY: number = 0.5 } ``` -------------------------------- ### Phaser Editor MCP Server - Filter Base Class Source: https://github.com/phaserjs/editor-mcp-server/blob/main/src/system-prompt.md Defines the base 'Filter' class with padding properties for applying spacing around filter effects. It extends 'VariableComponent' and allows for left, right, top, and bottom padding adjustments, often using negative values for effect creation. ```typescript abstract class Filter extends VariableComponent { constructor(label) // The padding to apply to the left side of the filter. This is useful for filters that need extra space on the left side. Often it uses negative values to create a space for the filter effect. paddingLeft: number = 0 // The padding to apply to the right side of the filter. This is useful for filters that need extra space on the right side. paddingRight: number = 0 // The padding to apply to the top side of the filter. This is useful for filters that need extra space on the top side. Often it uses negative values to create a space for the filter effect. paddingTop: number = 0 // The padding to apply to the bottom side of the filter. This is useful for filters that need extra space on the bottom side. paddingBottom: number = 0 } ``` -------------------------------- ### SpineGameObject Component Source: https://github.com/phaserjs/editor-mcp-server/blob/main/src/system-prompt.md Represents a Spine animation GameObject. It extends GameObject and includes components for transformation, visibility, and blend mode, with properties for managing Spine data, atlases, skins, and animations. ```JavaScript class SpineGameObject extends GameObject, TransformComponent, VisibleComponent, BlendModeComponent { constructor(x, y, dataKey, atlasKey, skinName, bpType, bpSkin, bpAnimation) // The key of the spine data (skeleton) asset dataKey: string // The key of the spine atlas asset. atlasKey: string // The name of the skin to use. A skeleton may have multiple skins. skinName: string enablePreview: boolean = false // You can find the animation names in the skeleton data. previewAnimation: string // The start time of the animation to preview. You can use it to advance the animation to a specific time. previewTime: number = 0 // The boundsProviderType. 0 = SETUP_TYPE, 1 = SKINS_AND_ANIMATION_TYPE. The most common is to use the SKINS_AND_ANIMATION_TYPE. It can use the same skin and animation used by the preview. bpType: number } ``` -------------------------------- ### Phaser Editor MCP Server - Shadow Filter Source: https://github.com/phaserjs/editor-mcp-server/blob/main/src/system-prompt.md Provides a 'Shadow' filter effect with configurable properties. Users can adjust the horizontal and vertical offset, decay, power, color, number of samples, and intensity of the shadow. ```typescript class Shadow extends Filter { // The horizontal offset of the shadow effect. x: number = 0 // The vertical offset of the shadow effect. y: number = 0 // The amount of decay for the shadow effect decay: number = 0.1 // The power of the shadow effect. power: number = 1 // The color of the shadow. color: string = "#000000" // The number of samples that the shadow effect will run for. This should be an integer with a minimum value of 1 and a maximum of 12. samples: number = 6 // The intensity of the shadow effect. intensity: number = 1 } ``` -------------------------------- ### Threshold Filter Properties Source: https://github.com/phaserjs/editor-mcp-server/blob/main/src/system-prompt.md Sets the threshold values for color channels and allows for inversion. `edge1` and `edge2` define the range for each channel, and `invert` controls channel inversion. ```javascript edge1: number[] = [0.5, 0.5, 0.5, 0.5] edge2: number[] = [0.5, 0.5, 0.5, 0.5] invert: number[] = [0, 0, 0, 0] ``` -------------------------------- ### Parent Component Configuration Source: https://github.com/phaserjs/editor-mcp-server/blob/main/src/system-prompt.md Determines if a prefab instance allows child Game Objects to be appended to it. This property is only relevant for prefab instances. ```TypeScript // If true, the prefab instance allows to append children game objects to it. If false, the prefab instance doesn't allow to append children game objects to it. In that case, the user cannot add children game objects to the prefab instance in the scene editor. This field is only valid for prefab instances. You always can add children to a parent game object that is not a prefab instance. class ParentComponent { allowAppendChildren: boolean = false } ``` -------------------------------- ### Shape Component Source: https://github.com/phaserjs/editor-mcp-server/blob/main/src/system-prompt.md An abstract base class for geometric shapes. It extends GameObject and includes components for transformation, visibility, alpha, and blend mode. Properties for fill color, stroke, and line width are provided. ```JavaScript abstract class Shape extends GameObject, TransformComponent, OriginComponent, VisibleComponent, AlphaSingleComponent, BlendModeComponent { // in hex format, e.g., "#ff0000" for red fillColor: string isFilled: boolean = true fillAlpha: number = 1 isStroked: boolean = false // in hex format, e.g., "#ff0000" for red strokeColor: string strokeAlpha: number = 1 lineWidth: number = 1 } ``` -------------------------------- ### Configure Physics Body Acceleration Source: https://github.com/phaserjs/editor-mcp-server/blob/main/src/system-prompt.md Sets the change in velocity for the physics body in pixels per second squared, affecting both horizontal (x) and vertical (y) movement. ```typescript body.acceleration.x: number = 0 body.acceleration.y: number = 0 ``` -------------------------------- ### Collider Callback Configuration Source: https://github.com/phaserjs/editor-mcp-server/blob/main/src/system-prompt.md Defines a JavaScript expression for a callback function executed when a collision is detected. The callback receives the two colliding objects as arguments. The `callbackContext` property specifies the execution context for this callback. ```javascript collideCallback: string callbackContext: string ``` -------------------------------- ### Color Matrix Filter Properties Source: https://github.com/phaserjs/editor-mcp-server/blob/main/src/system-prompt.md Configures a color matrix filter with various operation types and parameters like alpha, brightness, saturation, hue rotation, grayscale, contrast, and night intensity. The specific parameters used depend on the `operationType`. ```javascript operationType: ColorMatrixOperationType = ColorMatrixOperationType.NOP alpha: number = 1 matrixPreset: ColorMatrixPreset brightness: number = 0 saturate: number = 0 hueRotation: number = 0 grayscale: number = 1 contrast: number = 0 nightIntensity: number = 0.1 ``` -------------------------------- ### Configure Particle Emission Angle Source: https://github.com/phaserjs/editor-mcp-server/blob/main/src/system-prompt.md Defines the angle at which particles are emitted in degrees, and the initial rotation of each particle upon emission. ```javascript angle: EmitterOp_onEmitOnly rotate: EmitterOp_onEmitAndUpdate ``` -------------------------------- ### TileSprite Component Source: https://github.com/phaserjs/editor-mcp-server/blob/main/src/system-prompt.md Represents a TileSprite, which is an Image with tiling capabilities. It includes SizeComponent and properties for controlling the tile position and scale. ```JavaScript class TileSprite extends Image, SizeComponent { constructor(x, y, width, height, texture) tilePositionX: number = 0 tilePositionY: number = 0 tileScaleX: number = 1 tileScaleY: number = 1 } ``` -------------------------------- ### Container Component Source: https://github.com/phaserjs/editor-mcp-server/blob/main/src/system-prompt.md Represents a Container, a GameObject that can have a parent and be transformed. It includes visibility, alpha, and blend mode components, with a default blend mode of SKIP_CHECK. ```JavaScript class Container extends GameObject, ParentComponent, TransformComponent, VisibleComponent, AlphaSingleComponent, BlendModeComponent { // the default blendMode for the Container is SKIP_CHECK blendMode: BlendModes = BlendModes.SKIP_CHECK } ``` -------------------------------- ### Configure Physics Body Dimensions Source: https://github.com/phaserjs/editor-mcp-server/blob/main/src/system-prompt.md Sets the width and height for rectangular physics bodies. These properties are ignored for circular bodies. ```typescript body.width: number = 0 body.height: number = 0 ``` -------------------------------- ### Hit Area Component Configuration Source: https://github.com/phaserjs/editor-mcp-server/blob/main/src/system-prompt.md Configures the hit area for a Game Object, defining its shape, position, dimensions, and specific properties like radius or points. Supports various shapes including PIXEL_PERFECT with alpha tolerance. ```TypeScript // The way a hitArea is positioned within a game object depends on the area shape. Circles and ellipses are shapes with a center, so this center is usually placed at the center of the game object. To calculate the center of the game object, you can use its size. If the game object is 100x100 in size, and the hit area is a circle, then you could use a circle with radius 50 at position 50, 50. On the other hand, for a rectangle or polygon area, you wouldn't need to adjust its position, since they don't have a center and their top/left corner is aligned with the top/left corner of the game object. class HitAreaComponent { hitArea: { shape: "NONE" | "RECTANGLE" | "CIRCLE" | "ELLIPSE" | "POLYGON" | "PIXEL_PERFECT" = "NONE" // Used by the rectangle, ellipse, and circle shapes. x: number = 0 // Used by the rectangle, ellipse, and circle shapes. y: number = 0 // Used by the rectangle and ellipse shapes. width: number = 0 // See width. height: number = 0 // Used by the circle shape. radius: number = 0 // The points of the polygon hit area. It should be a sequence of numbers, where each pair of numbers represents a point (x, y) in the polygon. For example, 'x1 y1 x2 y2 x3 y3' for a triangle. The points should be in clockwise order. points: string // The alpha tolerance value, between 0 and 255. Used by the pixel perfect shape. alphaTolerance: number = 1 } } ``` -------------------------------- ### Alpha Component Configuration Source: https://github.com/phaserjs/editor-mcp-server/blob/main/src/system-prompt.md Manages the transparency of a Game Object, including per-corner alpha values. The default alpha is fully opaque. ```TypeScript class AlphaComponent { alpha: number = 1 alphaTopLeft: number = 1 alphaTopRight: number = 1 alphaBottomLeft: number = 1 alphaBottomRight: number = 1 } ``` -------------------------------- ### Set Physics Body Gravity Source: https://github.com/phaserjs/editor-mcp-server/blob/main/src/system-prompt.md Defines the acceleration due to gravity for this specific physics body in pixels per second squared. The total gravity is the sum of this and the simulation's global gravity. ```typescript body.gravity.x: number = 0 body.gravity.y: number = 0 ``` -------------------------------- ### TextureConfig Properties Source: https://github.com/phaserjs/editor-mcp-server/blob/main/src/system-prompt.md Specifies the asset key for textures, and optionally the frame for atlases or sprite sheets. This is used to configure the visual appearance of game objects. ```TypeScript class TextureConfig { key: string frame?: string | number } ``` -------------------------------- ### Phaser Editor MCP Server - Tilemap Layer Classes Source: https://github.com/phaserjs/editor-mcp-server/blob/main/src/system-prompt.md Defines classes for `TilemapLayer` and `EditableTilemapLayer` used in Phaser Editor's MCP Server. These classes represent layers within a tilemap, inheriting properties from `GameObject` and various `Component` classes. ```typescript class TilemapLayer extends GameObject, TransformComponent, VisibleComponent { constructor(tilemapId, layerName, tilesets) // The `id` of the Tiled tilemap this layer belongs to. There are two type of tilemaps: Tiled tilemaps and EditableTilemaps. This is the `id` of the Tiled tilemap. tilemapId: string // The name of the layer in the Tiled tilemap. layerName: string // The name of the tilesets used by this layer. These should match the names defined in the tilemap's tilesets. tilesets: string[] } class EditableTilemapLayer extends GameObject, TransformComponent, VisibleComponent, BlendModeComponent { } ``` -------------------------------- ### Set Physics Body Drag Source: https://github.com/phaserjs/editor-mcp-server/blob/main/src/system-prompt.md Configures the drag applied to the physics body. When `useDamping` is false, this is the absolute loss of velocity per second squared. When `useDamping` is true, it's a damping multiplier (0-1). Drag is applied when acceleration is zero. ```typescript body.drag.x: number = 0 body.drag.y: number = 0 ``` -------------------------------- ### Configure Physics Body Velocity Source: https://github.com/phaserjs/editor-mcp-server/blob/main/src/system-prompt.md Sets the velocity of the physics body in pixels per second for both horizontal (x) and vertical (y) axes. ```typescript body.velocity.x: number = 0 body.velocity.y: number = 0 ``` -------------------------------- ### Phaser Editor MCP Server - Glow Filter Source: https://github.com/phaserjs/editor-mcp-server/blob/main/src/system-prompt.md Implements a 'Glow' filter effect. This class allows customization of the glow color, outer and inner strength, scale, knockout option, quality, and distance. ```typescript class Glow extends Filter { // The color of the glow effect. This value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. color: string = "#ffffff" // The strength of the glow inward from the edge of the Sprite. outerStrength: number = 4 // The strength of the inner glow effect. innerStrength: number = 0 // The scale of the glow effect. This multiplies the fixed distance. scale: number = 1 // If `true` only the glow is drawn, not the texture itself. knockout: boolean = false // The quality of the glow effect. This cannot be changed after the filter has been created. quality: number = 10 // The distance of the glow effect. This cannot be changed after the filter has been created. distance: number = 10 } ``` -------------------------------- ### Phaser Editor MCP Server - Displacement Filter Source: https://github.com/phaserjs/editor-mcp-server/blob/main/src/system-prompt.md Implements a 'Displacement' filter that shifts pixels based on a provided texture. It allows control over horizontal (x) and vertical (y) displacement amounts and requires a 'TextureConfig' for the displacement map. ```typescript class Displacement extends Filter { // The amount of horizontal displacement to apply. The maximum horizontal displacement in pixels is `x` multiplied by 0.5 times the width of the camera rendering the filter. x: number = 0.005 // The amount of vertical displacement to apply. The maximum vertical displacement in pixels is `y` multiplied by 0.5 times the height of the camera rendering the filter. y: number = 0.005 // The texture to be used for the displacement effect. You can only use a whole texture, not a frame from a texture atlas or sprite sheet. texture: TextureConfig } ``` -------------------------------- ### Set Physics Body Offset Source: https://github.com/phaserjs/editor-mcp-server/blob/main/src/system-prompt.md Defines the offset of the physics body's position relative to its game object's position, measured in source pixels. ```typescript body.offset.x: number = 0 body.offset.y: number = 0 ``` -------------------------------- ### Configure Collision Checks Source: https://github.com/phaserjs/editor-mcp-server/blob/main/src/system-prompt.md Sets which directions the physics body should perform collision checks for: none, up, down, left, or right. ```typescript body.checkCollision.none: boolean = false body.checkCollision.up: boolean = true body.checkCollision.down: boolean = true body.checkCollision.left: boolean = true body.checkCollision.right: boolean = true ``` -------------------------------- ### Configure Physics Body Friction Source: https://github.com/phaserjs/editor-mcp-server/blob/main/src/system-prompt.md Sets the friction applied to the physics body. If the body is `immovable` and in motion, friction affects how much of its motion is transferred to a riding body on each axis. ```typescript body.friction.x: number = 1 body.friction.y: number = 0 ``` -------------------------------- ### Add Editable Tilemap to Phaser Scene Source: https://github.com/phaserjs/editor-mcp-server/blob/main/README.md Adds a new editable tilemap to the scene. Editable tilemaps are treated as plain objects and are fully modifiable. ```javascript editor.scene.addEditableTilemap(tilemapData); ``` -------------------------------- ### Configure Physics Body Bounce Source: https://github.com/phaserjs/editor-mcp-server/blob/main/src/system-prompt.md Sets the rebound factor for the physics body following a collision, relative to 1. This affects how much velocity is retained after a bounce. ```typescript body.bounce.x: number = 0 body.bounce.y: number = 0 ``` -------------------------------- ### Blend Modes Enum and Component Source: https://github.com/phaserjs/editor-mcp-server/blob/main/src/system-prompt.md Defines various blend modes for rendering and a component to apply them to Game Objects. The default blend mode is NORMAL. ```TypeScript enum BlendModes { SKIP_CHECK, NORMAL, ADD, MULTIPLY, SCREEN, OVERLAY, DARKEN, LIGHTEN, COLOR_DODGE, COLOR_BURN, HARD_LIGHT, SOFT_LIGHT, DIFFERENCE, EXCLUSION, HUE, SATURATION, COLOR, LUMINOSITY, ERASE, SOURCE_IN, SOURCE_OUT, SOURCE_ATOP, DESTINATION_OVER, DESTINATION_IN, DESTINATION_OUT, DESTINATION_ATOP, LIGHTER, COPY, XOR, } class BlendModeComponent { blendMode: BlendModes = BlendModes.NORMAL } ``` -------------------------------- ### Sort Phaser Game Objects in Render List Source: https://github.com/phaserjs/editor-mcp-server/blob/main/README.md Sorts game objects within the current scene based on their render order. This ensures correct visual layering. ```javascript editor.scene.moveGameObjectInRenderList(gameObject, newIndex); ``` -------------------------------- ### Set Pushable Property Source: https://github.com/phaserjs/editor-mcp-server/blob/main/src/system-prompt.md Determines if this physics body can be pushed by another body during collisions. If `false`, it reflects all incoming velocity back to the colliding body. ```typescript body.pushable: boolean = true ``` -------------------------------- ### Save Current Scene Source: https://github.com/phaserjs/editor-mcp-server/blob/main/README.md Saves the current state and modifications of the active scene in the Phaser Editor. This ensures that all changes are persisted. ```bash npx @phaserjs/editor-mcp-server ide-save-scene ``` -------------------------------- ### NineSlice Component Source: https://github.com/phaserjs/editor-mcp-server/blob/main/src/system-prompt.md Implements a NineSlice sprite, allowing an image to be sliced into nine parts for scalable display. It incorporates various components for transformation, appearance, and sizing. ```JavaScript class NineSlice extends GameObject, TransformComponent, OriginComponent, FlipComponent, VisibleComponent, AlphaSingleComponent, BlendModeComponent, SingleTintComponent, TextureComponent, SizeComponent { constructor(x, y, width, height, texture) leftWidth: number = 0 rightWidth: number = 0 topHeight: number = 0 bottomHeight: number = 0 } ``` -------------------------------- ### Blend Filter Properties Source: https://github.com/phaserjs/editor-mcp-server/blob/main/src/system-prompt.md Configures the blend mode, amount, color, and texture for a blend effect. The blend mode determines how the game object interacts with the background, and the amount controls the intensity of the effect. ```javascript blendMode: BlendModes = BlendModes.NORMAL amount: number = 1 color: string = "#ffffff" texture: TextureConfig ``` -------------------------------- ### Update Multiple Phaser Plain Objects Source: https://github.com/phaserjs/editor-mcp-server/blob/main/README.md Updates properties of multiple existing plain objects in the scene. Requires an array of plain objects with new values. ```javascript editor.scene.updatePlainObjects(updatedPlainObjects); ``` -------------------------------- ### Phaser Editor MCP Server - Particle Emitter Operations Source: https://github.com/phaserjs/editor-mcp-server/blob/main/src/system-prompt.md Defines various operation types for particle emitters in Phaser Editor's MCP Server. These types control how particle properties like position, movement, and other attributes are set, either on emission or throughout their lifetime. ```typescript type EaseType = "Power0" | "Power1" | "Power2" | "Power3" | "Power4" | "Linear" | "Quad" | "Cubic" | "Quart" | "Quint" | "Sine" | "Expo" | "Circ" | "Elastic" | "Back" | "Bounce" | "Stepped" | "Quad.easeIn" | "Cubic.easeIn" | "Quart.easeIn" | "Quint.easeIn" | "Sine.easeIn" | "Expo.easeIn" | "Circ.easeIn" | "Elastic.easeIn" | "Back.easeIn" | "Bounce.easeIn" | "Quad.easeOut" | "Cubic.easeOut" | "Quart.easeOut" | "Quint.easeOut" | "Sine.easeOut" | "Expo.easeOut" | "Circ.easeOut" | "Elastic.easeOut" | "Back.easeOut" | "Bounce.easeOut" | "Quad.easeInOut" | "Cubic.easeInOut" | "Quart.easeInOut" | "Quint.easeInOut" | "Sine.easeInOut" | "Expo.easeInOut" | "Circ.easeInOut" | "Elastic.easeInOut" | "Back.easeInOut" | "Bounce.easeInOut" class EmitterOp_None { type = "None" } class EmitterOp_Static { type = "Static" // Static value value: number = 0 } class EmitterOp_Random { type = "Random" // Random value random: number[] } class EmitterOp_StartEndRandom { type = "StartEndRandom" start: number end: number // If true, the value will be random between start and end. randomFlag: boolean = false // Easing function to use for the value. ease: EaseType } class EmitterOp_Interpolation { type = "Interpolation" // An array of values which will be used for interpolation during the particles lifetime values: number[] // The interpolation function to be used. interpolation: "linear" | "catmull" | "bezier" = "linear" // The ease function used to control the rate of change through the values. ease: EaseType } class EmitterOp_Stepped { type = "Stepped" // The steps parameter allows you to control the placement of sequential particles across the start-end range. steps: number = 1 // The start of the range. start: number = 0 // The end of the range. end: number = 1 // As with the stepped emitter, particles are emitted in sequence, from 'start' to 'end' in step sized jumps. Normally, when a stepped emitter reaches the end it snaps around to the start value again. However, if you provide the 'yoyo' parameter then when it reaches the end it will reverse direction and start emitting back down to 'start' again. Depending on the effect you require this can often look better. yoyo: boolean = false } class EmitterOp_MinMax { type = "MinMax" // The minimum value of the range. A random value is selected between 'min' and 'max'. min: number = 0 // The maximum value of the range. A random value is selected between 'min' and 'max'. max: number = 0 // Whether to use integer values. int: boolean = false } type EmitterOp_onEmitAndUpdate = EmitterOp_None | EmitterOp_Static | EmitterOp_Random | EmitterOp_StartEndRandom | EmitterOp_Interpolation | EmitterOp_Stepped | EmitterOp_MinMax type EmitterOp_onEmitOnly = EmitterOp_None | EmitterOp_Static | EmitterOp_Random | EmitterOp_Stepped | EmitterOp_MinMax ``` -------------------------------- ### Update Multiple Phaser Game Objects Source: https://github.com/phaserjs/editor-mcp-server/blob/main/README.md Updates properties of multiple existing game objects in the scene. Accepts an array of objects with updated properties. ```javascript editor.scene.updateGameObjects(updatedGameObjects); ``` -------------------------------- ### Configure Particle Scale Source: https://github.com/phaserjs/editor-mcp-server/blob/main/src/system-prompt.md Sets the vertical and horizontal scale of emitted particles relative to the emitter's scale and any parent's scale. ```javascript scale: EmitterOp_onEmitAndUpdate scaleX: EmitterOp_onEmitAndUpdate scaleY: EmitterOp_onEmitAndUpdate ```