1.1.1 • Published 5 years ago

phaser3-drag-select v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

Phaser 3 Drag Select Plugin

Config settings

In your game config:

import DragSelectPlugin from 'path-to';

const config = {
    ...
    plugins: {
        global: [
            { key: 'DragSelectPlugin', plugin: DragSelectPlugin }
        ]
    },
    ...
this.dragSelect = this.plugins.start('DragSelectPlugin', 'dragSelect');
this.dragSelect.setup(this, {
    camera: <MainGameSceneCamera>,
    cameraEdgeAcceleration: 0.015,
    cameraEdgeBuffer: 50,
    childSelector: <Function>,
    dragCameraBy: 2,        // right-button
    mouseClickToTrack: 1,   // left-button
    mouseAmendSelectWith: 'shift',
    mouseToggleSelectWith: 'ctrl',
    outlineColor: 0x00ff00,
    outlineWidth: 2,
    onPreview: <Function>,
    onSelect: <Function>,
    rectBgColor: 0x33ff33,
    rectAlpha: 0.5,
});

Functions

setup(scene, config)

Kind: global function

ParamTypeDescription
scenePhaser.SceneTarget scene to attach the plugin's logic against
configObjectConfiguration object to pass to plugin

isEnabled() ⇒ Boolean

Returns the current "enabled" status of the Plugin's "interface" scene

Kind: global function

setConfig(config)

Updates the plugin's configuration with new values

Kind: global function

ParamTypeDescription
configObjectnew configuration object

disable()

If enabled, disable the plugin

Kind: global function

enable()

If not already enabled, enable the plugin

Kind: global function

1.1.1

5 years ago

1.1.0

5 years ago

1.0.1

5 years ago