Private
_alignPrivate
_canvasPrivate
_contextPrivate
_fullPrivate
_kmtPrivate
_touchPrivate
attributePrivate
boardPrivate
boardPrivate
lastPrivate
windowThis is an attribute that determines if the coordinate system should be aligned with the one of the HTML canvas element. The default is true.
The underlying camera of the board. The camera of the board can be switched. The boundaries are based on camera. Meaning you can have camera with different boundaries, and you can switch between them during runtime.
The context used to draw stuff on the canvas.
The control center of the board. The control center is responsible for handling the input events and dispatch the events to the pan, zoom, and rotation handlers. This exists to decouple the input events from the camera. The control center is the middle man. The default control center is just a simple relay. You can implement a control center that takes in other inputs. For example, an input to start camera animations.
Determines if the board should be full screen. If this is set to true, the width and height of the board will be set to the window's inner width and inner height respectively. If set to true the width and height of the board will resize with the window.
This is in sync with the canvas height and the camera view port height. This is not the board's height. If the limitEntireViewPort is set to true, the min zoom level is updated based on the height.
The strategy used to handle the keyboard, mouse events. The default strategy is the DefaultBoardKMTStrategy. You can implement your own strategy by implementing the BoardKMTStrategy interface.
Determines the behavior of the camera when the camera is at the edge of the boundaries. If set to true, the entire view port would not move beyond the boundaries. If set to false, only the center of the camera is bounded by the boundaries.
The max translation height of the camera. This is the maximum distance the camera can move in the vertical direction.
The max translation width of the camera. This is the maximum distance the camera can move in the horizontal direction.
The pan handler of the board. The pan handler is responsible for handling the pan events issued to the camera. It has the final say on how the camera should move. Restrictions and clamping behavior are implemented in the pan handler.
The strategy used to handle touch events. The default strategy is the DefaultTouchStrategy. You can implement your own strategy by implementing the BoardTouchStrategy interface.
This is in sync with the canvas width and the camera view port width. This is not the board's width. If the limitEntireViewPort is set to true, the min zoom level is updated based on the width of the canvas.
The zoom handler of the board. The zoom handler is responsible for handling the zoom events issued to the camera. It has the final say on how the camera should zoom. Restrictions and clamping behavior are implemented in the zoom handler.
Private
attributePrivate
bindPrivate
convertThe event name to listen for. The events are "pan", "zoom", and "rotate".
The callback function to call when the event is triggered. The event provided to the callback is different for the different events.
The converted point in world coordinates.
Add an camera movement event listener. The events are "pan", "zoom", and "rotate".
Add an input event listener. The events are "pan", "zoom", and "rotate". This is different from the camera event listener as this is for input events. Input event does not necesarily mean that the camera will move. The input event is the event that is triggered when the user interacts with the board.
Private
registerPrivate
removePrivate
windowGenerated using TypeDoc
Usage
Alternatively you can import the board class as from a subdirectory; this shaves the bundle size a bit but not a lot though. As the board is the overall entry point for the library.