移动自定义字体不起作用
我正在尝试使用拉斐尔的 print() 通过动画移动文本,但它不起作用:
var paper = Raphael(document.getElementById("stage"), 640, 480);
var text = paper.print(300, 200, "Test Text", paper.getFont("Yanone"), 50);
text.animate({
y: 400
}, 1000);
有人知道我可能会错过什么吗?
I'm trying to move a text via animation using raphael's print(), but it doesn't work:
var paper = Raphael(document.getElementById("stage"), 640, 480);
var text = paper.print(300, 200, "Test Text", paper.getFont("Yanone"), 50);
text.animate({
y: 400
}, 1000);
Anyone have ideas what I may be missing?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为如果您想稍后对其进行动画处理,您应该使用
text
函数而不是print
函数。我不知道为什么,但它有效...这是一个包含两种方法的示例:
在第二种方法中,您可以这样做:
I think you should use the
text
function instead of theprint
function if you want to animate it later. I'm not sure why but it works ...Here is an example with both ways of doing it:
And on the second one you can do this for example :