Alexander Stefanov
Alexander Stefanov

Reputation: 534

draw2d javascript library - multiline label

Do you have an idea how to create a multiline label with draw2d's draw2d.shape.basic.Label

Upvotes: 1

Views: 1059

Answers (2)

Alexander Stefanov
Alexander Stefanov

Reputation: 534

Actually, you can make a multiline label (at least visually) by setting label's text programatically with '\n' in it. Like label.setText('Some \n text'). But you can't do it 'manually', since you're typing in an <input type="text">

Upvotes: 1

Konstantin Dinev
Konstantin Dinev

Reputation: 34895

This library is using the HTML5 Canvas API. In order to draw text it is using the fillText() method which does not have multi-line support out of the box. In order to achieve such the text needs to be broken down into multiple labels, which I don't think this library has support for.

Upvotes: 1

Related Questions