- Joined
- May 3, 2020
- Messages
- 289
Hi.
I'm not too sure if this is a bug but this is what I experience.
I use DrawList.DrawText to draw text on the screen and if I would like to display the value of a variable that is static, it is works fine. However, if I change the value of the variable, it does not draw numbers on the screen but squares instead.
Image:
What you see on the image is that I increase the value of a variable every frame by 1 when I use Canvas.DrawText to draw this value on the screen, it is works fine, but when I use DrawList.DrawText I get squares drawn on the screen instead of numbers.
The code looks like this with the solution:
Is this a bug and is there any solution to this?
Thanks.
I'm not too sure if this is a bug but this is what I experience.
I use DrawList.DrawText to draw text on the screen and if I would like to display the value of a variable that is static, it is works fine. However, if I change the value of the variable, it does not draw numbers on the screen but squares instead.
Image:
What you see on the image is that I increase the value of a variable every frame by 1 when I use Canvas.DrawText to draw this value on the screen, it is works fine, but when I use DrawList.DrawText I get squares drawn on the screen instead of numbers.
The code looks like this with the solution:
Cerberus:
Import mojo2
Class Game Extends App
Field myCanvas:Canvas
Field myDrawList:DrawList
Field myVar:Int
Method OnCreate()
myCanvas = New Canvas()
SetUpdateRate(60)
myVar = 0
myDrawList = New DrawList()
End
Method OnUpdate()
myVar += 1
End
Method OnRender()
gameCanvas.Clear(0,0,1,1)
myCanvas.DrawText("Canvas.DrawText: " + myVar, 50, 50)
myDrawList.DrawText("DrawList.DrawText: " + myVar, 50, 100)
myDrawList.RenderDrawList(myDrawList, 50,100)
myDrawList.Reset()
gameCanvas.Flush()
End
End
Is this a bug and is there any solution to this?
Thanks.
Last edited: