Skip to content

Commit

Permalink
adds javascript API for sendMoveNode to reposition a node from within…
Browse files Browse the repository at this point in the history
… a frame html after it has already been added
  • Loading branch information
benptc committed May 1, 2019
1 parent 9a74793 commit efc9dfc
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions libraries/objectDefaultFiles/object.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@
this.sendGlobalMessage = makeSendStub('sendGlobalMessage');
this.sendResetNodes = makeSendStub('sendResetNodes');
this.sendCreateNode = makeSendStub('sendCreateNode');
this.sendMoveNode = makeSendStub('sendMoveNode');
this.subscribeToMatrix = makeSendStub('subscribeToMatrix');
this.subscribeToAcceleration = makeSendStub('subscribeToAcceleration');
this.setFullScreenOn = makeSendStub('setFullScreenOn');
Expand Down Expand Up @@ -851,6 +852,20 @@
}), '*');
};

this.sendMoveNode = function (name, x, y) {
parent.postMessage(JSON.stringify({
version: realityObject.version,
node: realityObject.node,
frame: realityObject.frame,
object: realityObject.object,
moveNode: {
name: name,
x: x,
y: y
}
}), '*');
};

// subscriptions
this.subscribeToMatrix = function() {
realityObject.sendMatrix = true;
Expand Down

0 comments on commit efc9dfc

Please sign in to comment.