Open belen-albeza opened 10 years ago
Added a jaws.Text to example9, seems to work: http://jawsjs.com/jawsjs/examples/example9.html
I've got some problems trying to center a Text element in the canvas.
This next line doesn't seem to work, and I think it is valid code: scoreboard = new jaws.Text({text: 'example', x: jaws.width/2, y: jaws.height/2, anchor: 'center'});
The solution was to avoid the use of the anchor tag (Text defaults it to 'top_left'), and center it manually hard coding the x value. Setting the value of y to 'jaws.height/2' worked.
I am not sure if there is a problem in jaws.Text or I am not using it correctly
I'm trying to use
jaws.Text
, but I cannot make it work and cannot find any example on how to use it :(Here's what I've tried so far (here's the jsfiddle)
What am I doing wrong? Thanks! :)