commit
12cdb8c47a
@ -1871,8 +1871,11 @@ core.ui.relocateCanvas(name, x, y)
|
|||||||
重新定位一个自定义画布。x和y为画布的左上角坐标。
|
重新定位一个自定义画布。x和y为画布的左上角坐标。
|
||||||
|
|
||||||
|
|
||||||
core.ui.resizeCanvas(name, width, height)
|
core.ui.resizeCanvas(name, width, height, styleOnly)
|
||||||
重新设置一个自定义画布的大小。width和height为新设置的宽高。此操作会清空画布。
|
重新设置一个自定义画布的大小。width和height为新设置的宽高。
|
||||||
|
styleOnly控制是否只修改画布的显示大小(而不修改画布的内部大小)。
|
||||||
|
如果styleOnly为true,则只修改其显示大小(即canvas.style.width);
|
||||||
|
否则,则会同时修改画布的显示大小和内部大小并清空画布内容。
|
||||||
|
|
||||||
|
|
||||||
core.ui.deleteCanvas(name)
|
core.ui.deleteCanvas(name)
|
||||||
|
|||||||
@ -1851,8 +1851,11 @@ core.ui.relocateCanvas(name, x, y)
|
|||||||
重新定位一个自定义画布。x和y为画布的左上角坐标。
|
重新定位一个自定义画布。x和y为画布的左上角坐标。
|
||||||
|
|
||||||
|
|
||||||
core.ui.resizeCanvas(name, width, height)
|
core.ui.resizeCanvas(name, width, height, styleOnly)
|
||||||
重新设置一个自定义画布的大小。width和height为新设置的宽高。此操作会清空画布。
|
重新设置一个自定义画布的大小。width和height为新设置的宽高。
|
||||||
|
styleOnly控制是否只修改画布的显示大小(而不修改画布的内部大小)。
|
||||||
|
如果styleOnly为true,则只修改其显示大小(即canvas.style.width);
|
||||||
|
否则,则会同时修改画布的显示大小和内部大小并清空画布内容。
|
||||||
|
|
||||||
|
|
||||||
core.ui.deleteCanvas(name)
|
core.ui.deleteCanvas(name)
|
||||||
|
|||||||
@ -1138,7 +1138,7 @@ events.prototype._action_showTextImage = function (data, x, y, prefix) {
|
|||||||
var loc = this.__action_getLoc(data.loc, 0, 0, prefix);
|
var loc = this.__action_getLoc(data.loc, 0, 0, prefix);
|
||||||
if (core.isReplaying()) data.time = 0;
|
if (core.isReplaying()) data.time = 0;
|
||||||
this.__action_doAsyncFunc(data.async || data.time == 0, core.showImage,
|
this.__action_doAsyncFunc(data.async || data.time == 0, core.showImage,
|
||||||
data.code, core.ui.textImage(data.text), loc[0], loc[1], 100, 100, data.opacity, data.time);
|
data.code, core.ui.textImage(data.text), null, loc, data.opacity, data.time);
|
||||||
}
|
}
|
||||||
|
|
||||||
events.prototype._action_hideImage = function (data, x, y, prefix) {
|
events.prototype._action_hideImage = function (data, x, y, prefix) {
|
||||||
|
|||||||
@ -353,7 +353,7 @@ ui.prototype.calWidth = function (name, text, font) {
|
|||||||
////// 字符串自动换行的分割 //////
|
////// 字符串自动换行的分割 //////
|
||||||
ui.prototype.splitLines = function (name, text, maxWidth, font) {
|
ui.prototype.splitLines = function (name, text, maxWidth, font) {
|
||||||
var ctx = this.getContextByName(name);
|
var ctx = this.getContextByName(name);
|
||||||
if (!ctx) return;
|
if (!ctx) return [text];
|
||||||
if (font) core.setFont(name, font);
|
if (font) core.setFont(name, font);
|
||||||
|
|
||||||
var contents = [];
|
var contents = [];
|
||||||
@ -2919,15 +2919,15 @@ ui.prototype.relocateCanvas = function (name, x, y) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
////// canvas重置 //////
|
////// canvas重置 //////
|
||||||
ui.prototype.resizeCanvas = function (name, width, height) {
|
ui.prototype.resizeCanvas = function (name, width, height, styleOnly) {
|
||||||
var ctx = core.dymCanvas[name];
|
var ctx = core.dymCanvas[name];
|
||||||
if (!core.isset(ctx)) return null;
|
if (!core.isset(ctx)) return null;
|
||||||
if (core.isset(width)) {
|
if (core.isset(width)) {
|
||||||
ctx.canvas.width = width;
|
if (!styleOnly) ctx.canvas.width = width;
|
||||||
ctx.canvas.style.width = width * core.domStyle.scale + 'px';
|
ctx.canvas.style.width = width * core.domStyle.scale + 'px';
|
||||||
}
|
}
|
||||||
if (core.isset(height)) {
|
if (core.isset(height)) {
|
||||||
ctx.canvas.height = height;
|
if (!styleOnly) ctx.canvas.height = height;
|
||||||
ctx.canvas.style.height = height * core.domStyle.scale + 'px';
|
ctx.canvas.style.height = height * core.domStyle.scale + 'px';
|
||||||
}
|
}
|
||||||
return ctx;
|
return ctx;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user