Haven’t been here in a while, work keeps me busy. But glad to be back with another question.
On our Babylon project we’ve decided it’s time to upgrade to the latest version (4.2.0 => 5.2.0).
There are two breaking changes that don’t seem to be mentioned in the major updates and changes lists for the releases:
- Property ‘textBaseline’ does not exist on type ‘ICanvasRenderingContext’. It seems to have been removed in this (old) commit. We use it in the code as follows:
const dynamicTexture = new DynamicTexture(...) const context = dynamicTexture.getContext() context.textBaseline = 'hanging'
- Properties ‘actualBoundingBoxAscent’ and ‘actualBoundingBoxDescent’ do not exist on type ‘ITextMetrics’. We use it as:
const textMetrics = dynamicTexture.getContext().measureText(text) const textHeight = Math.abs(textMetrics.actualBoundingBoxAscent) + Math.abs(textMetrics.actualBoundingBoxDescent)
What are our alternatives to using these now?
Please let me know if more info is needed.