new "shown?" predicate

pull/89/head
jmoenig 2019-06-01 11:41:05 +02:00
rodzic 073f9ca94e
commit 10b1dd1d4d
2 zmienionych plików z 13 dodań i 0 usunięć

Wyświetl plik

@ -28,6 +28,7 @@
* new "get graphic effect" reporter * new "get graphic effect" reporter
* new "get pen attribute" reporter * new "get pen attribute" reporter
* new "pen down?" predicate * new "pen down?" predicate
* new "shown?" predicate
* new "write" command in pen category (used to be "label" in tools) * new "write" command in pen category (used to be "label" in tools)
* new "numbers", "is empty", "map","keep", "find", "combine" and "for each" primitives in list category * new "numbers", "is empty", "map","keep", "find", "combine" and "for each" primitives in list category
* new JIT-compiler "blitz-HOF" primitives for "map", "keep", "find" & "combine" via "compile" * new JIT-compiler "blitz-HOF" primitives for "map", "keep", "find" & "combine" via "compile"
@ -86,6 +87,7 @@
### 2019-06-01 ### 2019-06-01
* Objects: new "pen down?" predicate * Objects: new "pen down?" predicate
* Objects: new "shown?" predicate
### 2019-05-31 ### 2019-05-31
* Threads: optimized FOREACH performance for large linked lists * Threads: optimized FOREACH performance for large linked lists

Wyświetl plik

@ -398,6 +398,12 @@ SpriteMorph.prototype.initBlocks = function () {
category: 'looks', category: 'looks',
spec: 'hide' spec: 'hide'
}, },
reportShown: {
only: SpriteMorph,
type: 'predicate',
category: 'looks',
spec: 'shown?'
},
goToLayer: { goToLayer: {
only: SpriteMorph, only: SpriteMorph,
type: 'command', type: 'command',
@ -2193,6 +2199,7 @@ SpriteMorph.prototype.blockTemplates = function (category) {
blocks.push('-'); blocks.push('-');
blocks.push(block('show')); blocks.push(block('show'));
blocks.push(block('hide')); blocks.push(block('hide'));
blocks.push(block('reportShown'));
blocks.push('-'); blocks.push('-');
blocks.push(block('goToLayer')); blocks.push(block('goToLayer'));
blocks.push(block('goBack')); blocks.push(block('goBack'));
@ -4043,6 +4050,10 @@ SpriteMorph.prototype.show = function () {
this.parts.forEach(function (part) {part.show(); }); this.parts.forEach(function (part) {part.show(); });
}; };
SpriteMorph.prototype.reportShown = function () {
return this.isVisible;
};
// SpriteMorph pen color // SpriteMorph pen color
SpriteMorph.prototype.setColorComponentHSVA = function (idx, num) { SpriteMorph.prototype.setColorComponentHSVA = function (idx, num) {