-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Started work on Drawing-Shape and Tile-Mesh
- Loading branch information
Showing
3 changed files
with
163 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,143 @@ | ||
export {}; | ||
|
||
declare global { | ||
/** | ||
* A special subclass of PIXI.Container used to represent a Drawing in the PrimaryCanvasGroup. | ||
*/ | ||
class DrawingShape extends PrimaryCanvasObjectMixin(PIXI.Graphics) { | ||
Check failure on line 7 in src/foundry/client/pixi/placeables/primary-canvas-objects/drawing-shape.d.ts GitHub Actions / type check code base
|
||
/** | ||
* Sorting values to deal with ties. | ||
*/ | ||
static PRIMARY_SORT_ORDER: number; | ||
|
||
/** | ||
* @defaultValue | ||
* ```js | ||
* return foundry.utils.mergeObject(super.defaultData, { | ||
* shape: { | ||
* type: "", | ||
* width: 0, | ||
* height: 0, | ||
* radius: null, | ||
* points: [] | ||
* }, | ||
* bezierFactor: 0, | ||
* fillType: 0, | ||
* fillColor: 0x7C7C7C, | ||
* fillAlpha: 0.5, | ||
* strokeWidth: 8, | ||
* strokeColor: 0xFFFFFF, | ||
* strokeAlpha: 1, | ||
* text: "New Text", | ||
* fontFamily: "Signika", | ||
* fontSize: 48, | ||
* textColor: 0xFFFFFF, | ||
* textAlpha: 1 | ||
* }) | ||
* ``` | ||
*/ | ||
static override get defaultData(): DrawingShape.PrimaryCanvasObjectDrawingShapeData & PrimaryCanvasObject.Data; | ||
|
||
override refresh(): void; | ||
|
||
override setPosition(): void; | ||
|
||
protected override _getCanvasDocumentData(data: Document): unknown; | ||
|
||
/** | ||
* Draw rectangular shapes. | ||
*/ | ||
protected _drawRectangle(): void; | ||
|
||
/** | ||
* Draw ellipsoid shapes. | ||
*/ | ||
protected _drawEllipse(): void; | ||
|
||
/** | ||
* Draw polygonal shapes. | ||
*/ | ||
protected _drawPolygon(): void; | ||
|
||
/** | ||
* Draw freehand shapes with bezier spline smoothing. | ||
*/ | ||
protected _drawFreehand(): void; | ||
} | ||
|
||
namespace DrawingShape { | ||
type PrimaryCanvasObjectDrawingShapeData = { | ||
/** The shape */ | ||
shape: object; | ||
|
||
/** The x-coordinate of the PCO location */ | ||
x: number; | ||
|
||
/** The y-coordinate of the PCO location */ | ||
y: number; | ||
|
||
/** The z-index of the PCO */ | ||
z: number; | ||
|
||
/** The bezier factor */ | ||
bezierFactor: number; | ||
|
||
/** The fill type */ | ||
fillType: number; | ||
|
||
/** The fill color */ | ||
fillColor: number; | ||
|
||
/** The fill alpha */ | ||
fillAlpha: number; | ||
|
||
/** The stroke width */ | ||
strokeWidth: number; | ||
|
||
/** The stroke color */ | ||
strokeColor: number; | ||
|
||
/** The stroke alpha */ | ||
strokeAlpha: number; | ||
|
||
/** The text */ | ||
text: string; | ||
|
||
/** The text font family */ | ||
fontFamily: string; | ||
|
||
/** The font size */ | ||
fontSize: number; | ||
|
||
/** The text color */ | ||
textColor: number; | ||
|
||
/** The text alpha */ | ||
textAlpha: number; | ||
|
||
/** The rotation of this PCO */ | ||
rotation: number; | ||
|
||
/** The PCO is hidden? */ | ||
hidden: boolean; | ||
|
||
/** The elevation of the PCO */ | ||
elevation: number; | ||
|
||
/** The sort key that resolves ties among the same elevation */ | ||
sort: number; | ||
|
||
/** The PCO is considered as a roof? */ | ||
roof: boolean; | ||
|
||
/** The PCO is considered as overhead? */ | ||
overhead: boolean; | ||
|
||
/** The occlusion object for this PCO */ | ||
occlusion: object; | ||
|
||
/** The data texture values */ | ||
texture: object; | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
export {}; | ||
|
||
declare global { | ||
/** | ||
* A SpriteMesh which visualizes a Tile object in the PrimaryCanvasGroup. | ||
*/ | ||
class TileMesh extends OccludableObjectMixin(SpriteMesh) { | ||
override refresh(): void; | ||
Check failure on line 8 in src/foundry/client/pixi/placeables/primary-canvas-objects/tile-mesh.d.ts GitHub Actions / type check code base
|
||
|
||
override setPosition(x: number, y: number): void; | ||
Check failure on line 10 in src/foundry/client/pixi/placeables/primary-canvas-objects/tile-mesh.d.ts GitHub Actions / type check code base
|
||
|
||
override updateBounds(): void; | ||
Check failure on line 12 in src/foundry/client/pixi/placeables/primary-canvas-objects/tile-mesh.d.ts GitHub Actions / type check code base
|
||
} | ||
} |