I have spent hours reading and trying solutions to other people's wrapping problems and nothing is working.
I am using Crafty to build a game and want to display one line of instructions but no matter how I style the text it keeps wrapping at every space. If I take the spaces out, the whole sentence displays on one line. With spaces, each word is on its own line. I have tried float & white-space, align: justify, changing the coordinates, changing the font size, you name it. I am working in the JavaScript, not HTML. TIA
Here is what I have:
var helloWorldText = Crafty.e('2D, DOM, Text')
.attr({
x: 350,
y: 10
});
helloWorldText.text("Click on the matching character.");
helloWorldText.float(left);
helloWorldText.whiteSpace(nowrap);
helloWorldText.textColor('black');
helloWorldText.textFont({
size: '14px',
textAlign: justify
});