mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 15:02:52 -05:00
Merge pull request #1099 from towerofnix/scrollcompat-vm
"Implement" scroll blocks
This commit is contained in:
commit
54ee628b27
2 changed files with 46 additions and 1 deletions
|
@ -34,7 +34,13 @@ class Scratch3MotionBlocks {
|
||||||
motion_sety: this.setY,
|
motion_sety: this.setY,
|
||||||
motion_xposition: this.getX,
|
motion_xposition: this.getX,
|
||||||
motion_yposition: this.getY,
|
motion_yposition: this.getY,
|
||||||
motion_direction: this.getDirection
|
motion_direction: this.getDirection,
|
||||||
|
// Legacy no-op blocks:
|
||||||
|
motion_scroll_right: () => {},
|
||||||
|
motion_scroll_up: () => {},
|
||||||
|
motion_align_scene: () => {},
|
||||||
|
motion_xscroll: () => {},
|
||||||
|
motion_yscroll: () => {}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -206,6 +206,45 @@ const specMap = {
|
||||||
argMap: [
|
argMap: [
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
'scrollRight': {
|
||||||
|
opcode: 'motion_scroll_right',
|
||||||
|
argMap: [
|
||||||
|
{
|
||||||
|
type: 'input',
|
||||||
|
inputOp: 'math_number',
|
||||||
|
inputName: 'DISTANCE'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
'scrollUp': {
|
||||||
|
opcode: 'motion_scroll_up',
|
||||||
|
argMap: [
|
||||||
|
{
|
||||||
|
type: 'input',
|
||||||
|
inputOp: 'math_number',
|
||||||
|
inputName: 'DISTANCE'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
'scrollAlign': {
|
||||||
|
opcode: 'motion_align_scene',
|
||||||
|
argMap: [
|
||||||
|
{
|
||||||
|
type: 'field',
|
||||||
|
fieldName: 'ALIGNMENT'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
'xScroll': {
|
||||||
|
opcode: 'motion_xscroll',
|
||||||
|
argMap: [
|
||||||
|
]
|
||||||
|
},
|
||||||
|
'yScroll': {
|
||||||
|
opcode: 'motion_yscroll',
|
||||||
|
argMap: [
|
||||||
|
]
|
||||||
|
},
|
||||||
'say:duration:elapsed:from:': {
|
'say:duration:elapsed:from:': {
|
||||||
opcode: 'looks_sayforsecs',
|
opcode: 'looks_sayforsecs',
|
||||||
argMap: [
|
argMap: [
|
||||||
|
|
Loading…
Reference in a new issue