getTextsURL: function (page) {
return 'data/contents/p' + page + '.svg';
- }, setBackground: function (page, callback) {
+ },
+
+ setBackground: function (page, callback) {
var $this = this;
var back = $("#page_" + page + ' .background');
this._loadBackground(page, function () {
$(back).append($this.backgrounds[page]);
callback();
});
- }, setOnStage: function (element) {
+ },
+
+ setOnStage: function (element) {
if (element === undefined || element == null) {
return;
}
if (!isOnStage(element)) {
$("#loadedcontents").append($(element));
}
- }, _loadBackground: function (page, callback) {
+ },
+
+ _loadBackground: function (page, callback) {
if (page <= 0 || page > this.fluidbook.settings.pages) {
callback();
return;
this.__loadBackground(page, callback);
}
}
- }, __loadBackground: function (page, callback) {
+ },
+
+ __loadBackground: function (page, callback) {
if (page <= 0 || page > this.fluidbook.settings.pages) {
callback();
return;
return false;
}
this.backgrounds[page] = this.loadImage(url, null, null, null, page, callback);
- }, needSeparateTextures: function (page) {
+ },
+
+ needSeparateTextures: function (page) {
if (this._needSeparateTextures[page] === undefined) {
var $this = this;
this._needSeparateTextures[page] = false;
});
}
return this._needSeparateTextures[page];
- }, loadTexture: function (page, callback, enter) {
+ },
+
+ loadTexture: function (page, callback, enter) {
if (enter === undefined) {
enter = true;
}
var top = parseFloat($(this).css('top')) * hr;
var width = parseFloat($(this).css('width')) * wr;
var height = parseFloat($(this).css('height')) * hr;
+
+ var blendmode=$(this).data('blendmode');
+
+ if (blendmode === 'normal') {
+ ctx.globalCompositeOperation = 'source-over';
+ } else {
+ try {
+ ctx.globalCompositeOperation = blendmode;
+ } catch (e) {
+ ctx.globalCompositeOperation = 'source-over';
+ }
+ }
+
if ($(this).is('[data-color]')) {
ctx.fillStyle = $(this).attr('data-color');
ctx.fillRect(left, top, width, height);