updates to add "ask" functionality
This commit is contained in:
parent
3842832e52
commit
1beed456cc
17 changed files with 809 additions and 24 deletions
js/primitives
|
@ -43,6 +43,9 @@ LooksPrims.prototype.addPrimsTo = function(primTable) {
|
|||
primTable['setGraphicEffect:to:'] = this.primSetEffect;
|
||||
primTable['filterReset'] = this.primClearEffects;
|
||||
|
||||
primTable['doAsk'] = this.primDoAsk;
|
||||
primTable['answer'] = this.primAnswer;
|
||||
|
||||
primTable['say:'] = function(b) { showBubble(b, 'say'); };
|
||||
primTable['say:duration:elapsed:from:'] = function(b) { showBubbleAndWait(b, 'say'); };
|
||||
primTable['think:'] = function(b) { showBubble(b, 'think'); };
|
||||
|
@ -170,6 +173,17 @@ LooksPrims.prototype.primClearEffects = function(b) {
|
|||
s.updateFilters();
|
||||
};
|
||||
|
||||
LooksPrims.prototype.primDoAsk= function(b) {
|
||||
showBubble(b, "doAsk");
|
||||
var s = interp.targetSprite();
|
||||
if (s != null) s.showAsk();
|
||||
};
|
||||
|
||||
LooksPrims.prototype.primAnswer = function() {
|
||||
var s = interp.targetSprite();
|
||||
return ((s != null) ? s.answer : undefined);
|
||||
};
|
||||
|
||||
var showBubble = function(b, type) {
|
||||
var s = interp.targetSprite();
|
||||
if (s != null) s.showBubble(interp.arg(b, 0), type);
|
||||
|
|
Reference in a new issue