Skip to content

Commit

Permalink
DT/cameracontrols: Translate and cast the new stage to world blocks (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
yuri-kiss authored Dec 25, 2024
1 parent 5c00ffb commit 9fd4d4d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions extensions/DT/cameracontrols.js
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@
{
opcode: "blocktx",
blockType: Scratch.BlockType.REPORTER,
text: "stage to world x: [x]",
text: Scratch.translate("stage to world x: [x]"),
arguments: {
x: {
type: Scratch.ArgumentType.NUMBER,
Expand All @@ -424,7 +424,7 @@
{
opcode: "blockty",
blockType: Scratch.BlockType.REPORTER,
text: "stage to world y: [y]",
text: Scratch.translate("stage to world y: [y]"),
arguments: {
y: {
type: Scratch.ArgumentType.NUMBER,
Expand Down Expand Up @@ -568,10 +568,10 @@
return cameraDirection;
}
blocktx(args) {
return _translateX(args.x);
return _translateX(Scratch.Cast.toNumber(args.x));
}
blockty(args) {
return _translateY(args.y);
return _translateY(Scratch.Cast.toNumber(args.y));
}
setCol(args, util) {
cameraBG = args.val;
Expand Down

0 comments on commit 9fd4d4d

Please sign in to comment.