-
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.
- Loading branch information
Showing
4 changed files
with
113 additions
and
5 deletions.
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
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
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,62 @@ | ||
export {}; | ||
|
||
type Color = number; | ||
|
||
declare global { | ||
/** | ||
* A SpriteMesh which visualizes a Token object in the PrimaryCanvasGroup. | ||
*/ | ||
class TokenMesh extends OccludableObjectMixin(SpriteMesh) { | ||
/** | ||
* Sorting values to deal with ties. | ||
* @defaultValue `750` | ||
*/ | ||
static PRIMARY_SORT_ORDER: number; | ||
|
||
static override get defaultData(): TokenMesh.Data; | ||
|
||
override refresh(): void; | ||
|
||
override setPosition(x: number, y: number): void; | ||
|
||
override updateBounds(): void; | ||
|
||
protected override _getTextureCoordinate(testX: number, testY: number): { x: number; y: number } | null; | ||
|
||
/** | ||
* Get the attributes for this TokenMesh which configure the display of this TokenMesh and are compatible | ||
* with CanvasAnimation. | ||
*/ | ||
getDisplayAttributes(): TokenMeshDisplayAttributes; | ||
} | ||
|
||
namespace TokenMesh { | ||
type Data = { | ||
/** | ||
* Is this TokenMesh rotation locked? | ||
* @defaultValue `false` | ||
*/ | ||
lockRotation: boolean; | ||
} & ReturnType<typeof OccludableObjectMixin<typeof SpriteMesh>>["defaultData"]; | ||
} | ||
|
||
type TokenMeshDisplayAttributes = { | ||
x: number; | ||
|
||
y: number; | ||
|
||
width: number; | ||
|
||
height: number; | ||
|
||
alpha: number; | ||
|
||
rotation: number; | ||
|
||
scaleX: number; | ||
|
||
scaleY: number; | ||
|
||
tint: Color; | ||
}; | ||
} |