/** * This class represents a line line on the canvas * @author Eirik Måseidvåg */ import { CanvasElementName } from '..'; import { LineOptions, LineStrokeStyle, LineHeadStyle } from './types'; import CanvasElement from '../abstract/CanvasElement'; export default class Line extends CanvasElement { /** * The color of the stroke. Represented as a hexadecimal number * E.g. 0xffffff (white) * @public */ color: number; /** * The width of the stroke * @public */ strokeWidth: number; /** * The style of the lines border * @public */ strokeStyle: LineStrokeStyle; /** * The style of the lines border * @public */ headStyle: LineHeadStyle; /** * The opacity of the lines body. Represented by a float between 0 and 1 * @public */ opacity: number; /** * The point to draw the line from * @public */ from: { x: number; y: number; }; /** * The point to draw the line to * @public */ to: { x: number; y: number; }; /** * Returns the type of this canvas element * @returns CanvasElementName.LINE */ name: CanvasElementName; /** * Construct the object * @param options: LineOptions */ constructor(options: LineOptions); }