Hi, i did a thing (Multitouch Snap!)

I do not know how to create extra categories but I know to add blocks so I’m gonna add the tracking hand blocks to the sensing category

Wait what’s your os on your computer!

Tell me when your done with the finished file ok?

it works (for now). after 4 seconds the hands that were created that are NOT the primary get removed.

Sorry I was gone for a loting time I’m back(from my iPad being dead I wanted to wait for a long time to make it charged high

What have you added to morphic.js which keywords like HandMorph is a keyword or HandMorph.something

most of the changes are in the WorldMorph, however some changes have been made to the HandMorph such as pointerId, createTime, inUse, and isPrimary.

the pointerId property will sometimes not be accurate, such as iOS, where every standard is ignored. so don't rely on it, nor the the actual hand due to it getting freed from memory on iOS.

all of the functions prefixed with processTouch in HandMorph have all been altered from only supporting one finger, to multiple.

Could you add a get mouseX of each finger and a get MouseY of each finger and kinda put it into a list I made a track hands block

you can yourself, go near line 6736 and alter the functions with these:

Process.prototype.reportMousePosition = function () {
    var world, pos;
    if (this.homeContext.receiver) {
        world = this.homeContext.receiver.world();
        if (world) {
            if (world.hands.length === 1) {
                pos = this.homeContext.receiver.snapPoint(world.hand.position());
                return new List([pos.x, pos.y]);
            } else {
                var result = [];
                for (let i = 0; i < world.hands.length; i++) {
                    const hand = world.hands[i];
                    let point = this.homeContext.receiver.snapPoint(hand.position());
                    result.push(new List([point.x, point.y]));
                }
                return new List(result);
            }
        }
    }
    return '';
};

Process.prototype.reportMouseX = function () {
    var world;
    if (this.homeContext.receiver) {
        world = this.homeContext.receiver.world();
        if (world) {
            if (world.hands.length === 1) {
                return this.homeContext.receiver.snapPoint(world.hand.position()).x;
            } else {
                return new List(world.hands.map((hand) => this.homeContext.receiver.snapPoint(hand.position()).x));
            }
        }
    }
    return 0;
};

Process.prototype.reportMouseY = function () {
    var world;
    if (this.homeContext.receiver) {
        world = this.homeContext.receiver.world();
        if (world) {
            if (world.hands.length === 1) {
                return this.homeContext.receiver.snapPoint(world.hand.position()).y;
            } else {
                return new List(world.hands.map((hand) => this.homeContext.receiver.snapPoint(hand.position()).y));
            }
        }
    }
    return 0;
};

i'm currently just fixing a few bugs that are left.

an example of a bug is world.hand doesn't always return a hand. the inUse flag in the HandMorph determines which one should be world.hand.

Thanks

the world hand bug seems to be fixed. i repeat seems.

laptops with touchscreens should now completely work.

Im trying to work on the TrackHands block and I need it to put a list of fingers (X and Y positions)

that's that's literally what i gave you earlier. it just checks if there is multiple pointers and if there is it reports the x's and y's of each pointer when using the mouse position block. however if there isn't multiple pointers that won't happen.

I keep getting 0

what. what do you mean by 0.


Btw I’m using working copy

you're suppose to paste the code i gave you in threads.js in the "src" folder, near line 6736.

just find "reportMousePosition" function of Process and just remove the next three functions and paste the code in it's place.

Also this keeps happening


But I’ll do that