3

The is slight difference in the top position of text object rendered by firefox to other browsers in CreateJs while the shapes object does not show this difference.

For instance,

this.text = new cjs.Text("Click to Start", '500 47px Hel');
this.text.textAlign = "center";
this.text.lineHeight = 110;
this.text.lineWidth = 289;
this.text.setTransform(119.5, 5);

it will give slightly different top position relative to the other graphics surrounding this text in firefox or chrome. Is there any way to solve this issue?

Suresh Mahawar
  • 1,458
  • 15
  • 34
NNS
  • 195
  • 1
  • 1
  • 9
  • You might have implement a simple browser-sniffer, and make browser-specific changes. – Lanny Apr 22 '14 at 15:57
  • I haven't tried anything browser specific. I have researched on the topic and found there is approx 7 px difference in the positioning of text in mozilla than in other browsers.The code i have is too long (above mentioned was a small fraction of that). So if i try detecting the browser and make changes in positioning that will be a time consuming process so if anything else anyone can suggest that will be a great help. – NNS Apr 23 '14 at 09:40

1 Answers1

0

If your text is static (the button text never changes throughout the game / app) then you could decide to make the button an image. A CreateJS canvas is an image anyway, so visually there should not be any difference.

Kokodoko
  • 26,167
  • 33
  • 120
  • 197