Hi! I’m trying to place some text in the upper left-hand corner of the screen. I am setting the camera to follow another sprite and then adding text like this:
const scoreText = this.add.text(-100, -100, 'Hello World', { fontFamily: '"Roboto Condensed"', fontSize: 'px' })
scoreText.scrollFactorX = 0
scoreText.scrollFactorY = 0
scoreText.setFontSize(60)
The issue is that the text is not in the upper left hand corner, it’s about 200 pixels to the right and below where I would like it to be.
-
I tried using negative positioning numbers, but that still seems to place it in the same place as (0,0) positioning
-
I tried using setPosition, but that didn’t seem to have any effect.
-
I tried adding the test to the main camera rather than adding it to the scene, but that just gave me an error…
Does anyone know how I can position the text exactly in the upper left corner of the screen, sort of like a HUD for the game?
thanks!