Partially implemented filter effects
Implemented ghost effect
This commit is contained in:
parent
d25c07538a
commit
6bd32857be
2 changed files with 22 additions and 3 deletions
js
|
@ -89,6 +89,9 @@ var Sprite = function(data) {
|
|||
this.soundsLoaded = 0;
|
||||
this.instrument = 1;
|
||||
|
||||
// Filter effects
|
||||
this.ghostFilterEffect = 0;
|
||||
|
||||
// Incremented when images are loaded by the browser.
|
||||
this.costumesLoaded = 0;
|
||||
|
||||
|
@ -296,6 +299,8 @@ Sprite.prototype.updateTransform = function() {
|
|||
$(this.mesh).css('-ms-transform-origin', rotationCenterX + 'px ' + rotationCenterY + 'px');
|
||||
$(this.mesh).css('-o-transform-origin', rotationCenterX + 'px ' + rotationCenterY + 'px');
|
||||
$(this.mesh).css('transform-origin', rotationCenterX + 'px ' + rotationCenterY + 'px');
|
||||
|
||||
$(this.mesh).css('opacity', ((100 - this.ghostFilterEffect) / 100));
|
||||
|
||||
// Don't forget to update the talk bubble.
|
||||
if (this.talkBubble) {
|
||||
|
|
|
@ -152,11 +152,25 @@ LooksPrims.prototype.primGoBack = function(b) {
|
|||
if(s.visible) interp.redraw();
|
||||
}
|
||||
|
||||
LooksPrims.prototype.primChangeEffect = function(b) {}
|
||||
LooksPrims.prototype.primChangeEffect = function(b) {
|
||||
var s = interp.targetSprite();
|
||||
var filter = interp.arg(b, 0);
|
||||
var currentValue = eval("s." + filter + "FilterEffect");
|
||||
eval("s." + filter + "FilterEffect = (currentValue + (interp.arg(b, 1)));");
|
||||
s.updateTransform();
|
||||
}
|
||||
|
||||
LooksPrims.prototype.primSetEffect = function(b) {}
|
||||
LooksPrims.prototype.primSetEffect = function(b) {
|
||||
var s = interp.targetSprite();
|
||||
var filter = interp.arg(b, 0);
|
||||
eval("s." + filter + "FilterEffect = (interp.arg(b, 1));");
|
||||
s.updateTransform();
|
||||
}
|
||||
|
||||
LooksPrims.prototype.primClearEffects = function(b) {}
|
||||
LooksPrims.prototype.primClearEffects = function(b) {
|
||||
var s = interp.targetSprite();
|
||||
s.ghostFilterEffect = 0;
|
||||
}
|
||||
|
||||
var showBubble = function(b, type) {
|
||||
var s = interp.targetSprite();
|
||||
|
|
Reference in a new issue