@latticexyz/phaserx
#
@latticexyz/phaserx
#
Table of contents
#
Enumerations
#
Classes
#
Interfaces
#
Type Aliases
Asset Camera Coord Key TileAnimation
#
Variables
GameObjectClasses ZERO_VECTOR
#
Functions
addCoords chunkCoordToTileCoord chunkToPixelCoord coordEq cornerTileCoordsFromRegionCoords createAnimatedTilemap createCamera createChunkedTilemap createChunks createCulling createDebugger createInput createObjectPool createPhaserEngine createVirtualTilemap defineAssetsConfig defineCameraConfig defineMapConfig definePhaserConfig defineScaleConfig defineScene defineSceneConfig generateFrames getChunksInArea getObjectsInArea isRectangle isSprite isTileInArea load mod pixelCoordToTileCoord pixelToChunkCoord removeAllTweens tileCoordToChunkCoord tileCoordToPixelCoord tween
#
Type Aliases
#
Asset
Ƭ Asset: { key
: string
; path
: string
; type
: Image
} | { key
: string
; options
: { frameHeight
: number
; frameWidth
: number
} ; path
: string
; type
: SpriteSheet
} | { key
: string
; options
: { imagePath
: string
} ; path
: string
; type
: MultiAtlas
}
#
Defined in
packages/phaserx/src/types.ts:176
#
Camera
Ƭ Camera: Object
#
Type declaration
#
Defined in
packages/phaserx/src/types.ts:13
#
Coord
Ƭ Coord: Object
#
Type declaration
#
Defined in
packages/phaserx/src/types.ts:54
#
Key
Ƭ Key: keyof typeof Phaser.Input.Keyboard.KeyCodes
| "POINTER_LEFT"
| "POINTER_RIGHT"
#
Defined in
packages/phaserx/src/createInput.ts:18
#
TileAnimation
Ƭ TileAnimation<TileKeys
>: TileKeys
[]
#
Type parameters
#
Defined in
packages/phaserx/src/tilemap/types.ts:28
#
Variables
#
GameObjectClasses
• Const
GameObjectClasses: Object
#
Type declaration
#
Defined in
packages/phaserx/src/constants.ts:7
#
ZERO_VECTOR
• Const
ZERO_VECTOR: Coord
#
Defined in
packages/phaserx/src/utils/coords.ts:3
#
Functions
#
addCoords
▸ addCoords(a
, b
): Object
#
Parameters
#
Returns
Object
#
Defined in
packages/phaserx/src/utils/coords.ts:34
#
chunkCoordToTileCoord
▸ chunkCoordToTileCoord(chunkCoord
, tileWidth
, tileHeight
, chunkSize
): WorldCoord
#
Parameters
#
Returns
WorldCoord
#
Defined in
packages/phaserx/src/utils/coords.ts:73
#
chunkToPixelCoord
▸ chunkToPixelCoord(chunkCoord
, chunkSize
): PixelCoord
#
Parameters
#
Returns
PixelCoord
#
Defined in
packages/phaserx/src/utils/coords.ts:45
#
coordEq
▸ coordEq(a?
, b?
): boolean
#
Parameters
#
Returns
boolean
#
Defined in
packages/phaserx/src/utils/coords.ts:28
#
cornerTileCoordsFromRegionCoords
▸ cornerTileCoordsFromRegionCoords(regionCoords
, regionLength
): Coord
#
Parameters
#
Returns
Coord
#
Defined in
packages/phaserx/src/utils/coords.ts:5
#
createAnimatedTilemap
▸ createAnimatedTilemap<TileKeys
, LayerKeys
, AnimationKeys
>(config
): AnimatedTilemap
<TileKeys
, LayerKeys
, AnimationKeys
>
#
Type parameters
#
Parameters
#
Returns
AnimatedTilemap
<TileKeys
, LayerKeys
, AnimationKeys
>
#
Defined in
packages/phaserx/src/tilemap/createAnimatedTilemap.ts:9
#
createCamera
▸ createCamera(phaserCamera
, options
): Camera
#
Parameters
#
Returns
Camera
#
Defined in
packages/phaserx/src/createCamera.ts:6
#
createChunkedTilemap
▸ createChunkedTilemap<TileKeys
, LayerKeys
>(params
): ChunkedTilemap
<TileKeys
, LayerKeys
>
#
Type parameters
#
Parameters
#
Returns
ChunkedTilemap
<TileKeys
, LayerKeys
>
#
Defined in
packages/phaserx/src/tilemap/createChunkedTilemap.ts:22
#
createChunks
▸ createChunks(worldView$
, chunkSize
, padding?
): Object
#
Parameters
#
Returns
Object
#
Defined in
packages/phaserx/src/createChunks.ts:6
#
createCulling
▸ createCulling(objectPool
, camera
, chunks
): Object
#
Parameters
#
Returns
Object
#
Defined in
packages/phaserx/src/createCulling.ts:45
#
createDebugger
▸ createDebugger(camera
, chunks
, scene
, objectPool
, map
): void
#
Parameters
#
Returns
void
#
Defined in
packages/phaserx/src/createDebugger.ts:13
#
createInput
▸ createInput(inputPlugin
): Object
#
Parameters
#
Returns
Object
#
Defined in
packages/phaserx/src/createInput.ts:20
#
createObjectPool
▸ createObjectPool(scene
): Object
#
Parameters
#
Returns
Object
#
Defined in
packages/phaserx/src/createObjectPool.ts:15
#
createPhaserEngine
▸ createPhaserEngine<S
>(options
): Promise
<{ dispose
: () => void
; game
: Game
; scenes
: Scenes
<S
> }>
#
Type parameters
#
Parameters
#
Returns
Promise
<{ dispose
: () => void
; game
: Game
; scenes
: Scenes
<S
> }>
#
Defined in
packages/phaserx/src/createPhaserEngine.ts:15
#
createVirtualTilemap
▸ createVirtualTilemap<TileKeys
, LayerKeys
>(config
): VirtualTilemap
<TileKeys
, LayerKeys
>
#
Type parameters
#
Parameters
#
Returns
VirtualTilemap
<TileKeys
, LayerKeys
>
#
Defined in
packages/phaserx/src/tilemap/createVirtualTilemap.ts:7
#
defineAssetsConfig
▸ defineAssetsConfig<A
>(assets
): A
#
Type parameters
#
Parameters
#
Returns
A
#
Defined in
packages/phaserx/src/guards.ts:17
#
defineCameraConfig
▸ defineCameraConfig(config
): CameraConfig
#
Parameters
#
Returns
CameraConfig
#
Defined in
packages/phaserx/src/guards.ts:41
#
defineMapConfig
▸ defineMapConfig<A
, T
, L
>(config
): MapConfig
<A
, T
, L
>
#
Type parameters
#
Parameters
#
Returns
MapConfig
<A
, T
, L
>
#
Defined in
packages/phaserx/src/guards.ts:21
#
definePhaserConfig
▸ definePhaserConfig(options
): Phaser.Types.Core.GameConfig
#
Parameters
#
Returns
Phaser.Types.Core.GameConfig
#
Defined in
packages/phaserx/src/definePhaserConfig.ts:3
#
defineScaleConfig
▸ defineScaleConfig(config
): ScaleConfig
#
Parameters
#
Returns
ScaleConfig
#
Defined in
packages/phaserx/src/guards.ts:37
#
defineScene
▸ defineScene(options
): typeof GameScene
#
Parameters
#
Returns
typeof GameScene
#
Defined in
packages/phaserx/src/defineScene.ts:3
#
defineSceneConfig
▸ defineSceneConfig<A
, S
, T
, M
, Ans
>(config
): SceneConfig
<A
, S
, T
, M
, Ans
>
#
Type parameters
#
Parameters
#
Returns
SceneConfig
<A
, S
, T
, M
, Ans
>
#
Defined in
packages/phaserx/src/guards.ts:27
#
generateFrames
▸ generateFrames<A
>(anims
, animation
): Phaser.Types.Animations.AnimationFrame
[]
#
Type parameters
#
Parameters
#
Returns
Phaser.Types.Animations.AnimationFrame
[]
#
Defined in
packages/phaserx/src/utils/generateFrames.ts:3
#
getChunksInArea
▸ getChunksInArea(area
, chunkSize
): CoordMap
<boolean
>
#
Parameters
#
Returns
CoordMap
<boolean
>
#
Defined in
packages/phaserx/src/utils/chunks.ts:5
#
getObjectsInArea
▸ getObjectsInArea(groups
, area
): any
[]
#
Parameters
#
Returns
any
[]
#
Defined in
packages/phaserx/src/utils/area.ts:2
#
isRectangle
▸ isRectangle(gameObject
, type
): gameObject is Rectangle
#
Parameters
#
Returns
gameObject is Rectangle
#
Defined in
packages/phaserx/src/guards.ts:52
#
isSprite
▸ isSprite(gameObject
, type
): gameObject is Sprite
#
Parameters
#
Returns
gameObject is Sprite
#
Defined in
packages/phaserx/src/guards.ts:45
#
isTileInArea
▸ isTileInArea(tileCoord
, area
): boolean
#
Parameters
#
Returns
boolean
#
Defined in
packages/phaserx/src/utils/coords.ts:19
#
load
▸ load(scene
, callback
): Promise
<void
>
#
Parameters
#
Returns
Promise
<void
>
#
Defined in
packages/phaserx/src/utils/load.ts:3
#
mod
▸ mod(a
, b
): number
#
Parameters
#
Returns
number
#
Defined in
packages/phaserx/src/utils/math.ts:1
#
pixelCoordToTileCoord
▸ pixelCoordToTileCoord(pixelCoord
, tileWidth
, tileHeight
): WorldCoord
#
Parameters
#
Returns
WorldCoord
#
Defined in
packages/phaserx/src/utils/coords.ts:49
#
pixelToChunkCoord
▸ pixelToChunkCoord(pixelCoord
, chunkSize
): ChunkCoord
#
Parameters
#
Returns
ChunkCoord
#
Defined in
packages/phaserx/src/utils/coords.ts:41
#
removeAllTweens
▸ removeAllTweens(gameObject
): void
#
Parameters
#
Returns
void
#
Defined in
packages/phaserx/src/utils/tween.ts:33
#
tileCoordToChunkCoord
▸ tileCoordToChunkCoord(tileCoord
, tileWidth
, tileHeight
, chunkSize
): ChunkCoord
#
Parameters
#
Returns
ChunkCoord
#
Defined in
packages/phaserx/src/utils/coords.ts:63
#
tileCoordToPixelCoord
▸ tileCoordToPixelCoord(tileCoord
, tileWidth
, tileHeight
): PixelCoord
#
Parameters
#
Returns
PixelCoord
#
Defined in
packages/phaserx/src/utils/coords.ts:56
#
tween
▸ tween(config
, options?
): Promise
<void
>
Add a tween to the provided game object.
#
Parameters
#
Returns
Promise
<void
>
Promise that resolves when the tween is done.
#
Defined in
packages/phaserx/src/utils/tween.ts:12