-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
54f293a
commit bd6125b
Showing
6 changed files
with
374 additions
and
165 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,21 @@ | ||
/.cache | ||
/dist | ||
/node_modules | ||
.cache | ||
.git | ||
.idea | ||
|
||
# build | ||
build | ||
dist | ||
|
||
# module | ||
node_modules | ||
|
||
# packager | ||
exe | ||
out | ||
|
||
package-lock.json | ||
Library/ | ||
src/assets/ui/reset_button.xcf | ||
src/data/config.json | ||
src/data/*.csv | ||
csv/*.csv |
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 |
---|---|---|
@@ -1,34 +1,40 @@ | ||
import { HandLandmarkIndex } from '../objects/handLandmarks' | ||
import { fingerColors, fingerSpriteDepth } from '../core/config' | ||
import { MatterSprite, Scene } from '../core/phaserTypes' | ||
import setInteraction from '../util/interaction' | ||
import { HandLandmarkIndex } from '../objects/handLandmarks'; | ||
import { fingerColors, fingerSpriteDepth } from '../core/config'; | ||
import { MatterSprite, Scene } from '../core/phaserTypes'; | ||
import setInteraction from '../util/interaction'; | ||
|
||
export default class Finger extends MatterSprite { | ||
public readonly name: string | ||
public readonly landmarkIndex: HandLandmarkIndex | ||
|
||
constructor(scene: Scene, spriteKey: string, name: string, landmarkIndex: HandLandmarkIndex, spriteScale: number) { | ||
public readonly name: string; | ||
public readonly landmarkIndex: HandLandmarkIndex; | ||
|
||
constructor( | ||
scene: Scene, | ||
spriteKey: string, | ||
name: string, | ||
landmarkIndex: HandLandmarkIndex, | ||
spriteScale: number, | ||
) { | ||
super(scene.matter.world, 0, 0, spriteKey, undefined, { | ||
render: { | ||
visible: true | ||
} | ||
}) | ||
visible: true, | ||
}, | ||
}); | ||
|
||
this.name = name | ||
this.landmarkIndex = landmarkIndex | ||
this.name = name; | ||
this.landmarkIndex = landmarkIndex; | ||
|
||
this.scene.add.existing(this) | ||
this.scene.add.existing(this); | ||
|
||
this.setScale(spriteScale) | ||
this.setTint(fingerColors[this.name]) | ||
this.setDepth(fingerSpriteDepth) | ||
this.setScale(spriteScale); | ||
this.setTint(fingerColors[this.name]); | ||
this.setDepth(fingerSpriteDepth); | ||
|
||
this.setCircle(this.displayWidth / 2, { | ||
label: this.name | ||
}) | ||
label: this.name, | ||
}); | ||
|
||
this.setSensor(true) | ||
this.setSensor(true); | ||
|
||
setInteraction(this, false) | ||
setInteraction(this, false); | ||
} | ||
} |
Oops, something went wrong.