Discord
Login
Community
DARK THEME

M2D draw text bug .

Demo bug >>>> https://microstudio.dev/i/Loginus/m2dtest2/

Using the M2D graphics library - the text is displayed upside down. It probably has to do with the fact that M2D tries to maintain similar graphics settings as a standard graphics library (keeps the origin of the frame of reference in the middle of the screen, and reverses the drawn image behind the scene).

But this behavior has a problem when you write text - because the text is now reversed.

You can get around this by reversing the text, but that seems so counterintuitive.

Yes, it shows it upside down. For now, as you figured out already, you have to turn it around.

init = function()
  scene = new M2D.Scene()
  camera = new M2D.Camera()
  sprite = new M2D.Sprite("icon",32,32)
  scene.add(sprite)
  text = new M2D.PIXI.Text( "1_2_3_4_5_6_7_8_9_0  123", object fontFamily= "BitCell" fontSize= 30 fill= 'white' end )
  text.scale.y = -1
  scene.add(text)
end

Just scale it in Y as shown above

Live Long and Tinker

Post a reply

Progress

Status

Preview
Cancel
Post
Validate your e-mail address to participate in the community