小编Tyl*_*ler的帖子

filltext()画布文本位置浏览器之间的差异

可以在问题底部的截图中看到,也可以 直接进入游戏.文本的放置取决于浏览器(firefox 15.0.1的呈现方式与IE 9.9和Chrome 21不同).调用绘图功能:

context.fillText(this.wlines[i], this.xcoord, this.ycoord + y + (t) * this.sizey);
Run Code Online (Sandbox Code Playgroud)

对象的构造函数:

function textItem(text, xcoord, ycoord, sizex, sizey,style, context) {
this.wlines = [];
this.text = text;
this.xcoord = xcoord;
this.ycoord = ycoord;
this.sizex = sizex;
this.sizey = sizey;
this.style = style;

if (text == null) {
    text = "";
}
var lines = text.split("~");
// this is first line text
context.save();
if (this.style < 3) {
    context.shadowOffsetY = 2;
    context.font = 'bold 18px "palatino linotype"';
} …
Run Code Online (Sandbox Code Playgroud)

javascript firefox internet-explorer canvas

8
推荐指数
1
解决办法
1909
查看次数

标签 统计

canvas ×1

firefox ×1

internet-explorer ×1

javascript ×1