mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 23:12:24 -05:00
Spec maps for scroll blocks + "implementations"
This commit is contained in:
parent
8a9818d0d4
commit
62b8dd93af
2 changed files with 47 additions and 1 deletions
|
@ -34,7 +34,12 @@ class Scratch3MotionBlocks {
|
|||
motion_sety: this.setY,
|
||||
motion_xposition: this.getX,
|
||||
motion_yposition: this.getY,
|
||||
motion_direction: this.getDirection
|
||||
motion_direction: this.getDirection,
|
||||
motion_scroll_right: this.doNothing,
|
||||
motion_scroll_up: this.doNothing,
|
||||
motion_align_scene: this.doNothing,
|
||||
motion_xscroll: this.doNothing,
|
||||
motion_yscroll: this.doNothing
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -254,6 +259,8 @@ class Scratch3MotionBlocks {
|
|||
getDirection (args, util) {
|
||||
return util.target.direction;
|
||||
}
|
||||
|
||||
doNothing () {}
|
||||
}
|
||||
|
||||
module.exports = Scratch3MotionBlocks;
|
||||
|
|
|
@ -206,6 +206,45 @@ const specMap = {
|
|||
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:': {
|
||||
opcode: 'looks_sayforsecs',
|
||||
argMap: [
|
||||
|
|
Loading…
Reference in a new issue