Hi everyone,
I just started my Monkey C journey and ran into this wall. Here's my code for drawing some text on the screen
- Simulated Device: Forerunner 245 Music
- SDK: 7.0.2 Beta
```
// Update the view
function onUpdate(dc as Dc) as Void {
//setLayout(Rez.Layouts.WatchFace(dc));
//dc.clear();
var width = dc.getWidth(); //width = 240
var height = dc.getHeight(); //height = 240
// Get and show the current time
var clockTime = System.getClockTime();
var timeString = Lang.format("$1$:$2$", [clockTime.hour, clockTime.min.format("%02d")]);
//timeString.draw(dc);
// Draw the time
dc.setColor(Graphics.COLOR_YELLOW, Graphics.COLOR_TRANSPARENT);
dc.drawText(
width/2,
height/2,
Graphics.FONT_LARGE,
timeString,
Graphics.TEXT_JUSTIFY_CENTER
);
// Another test draw
dc.setColor(Graphics.COLOR_BLUE, Graphics.COLOR_BLACK);
dc.fillRectangle(100, 100, 100, 100);
// Call the parent onUpdate function to redraw the layout
View.onUpdate(dc);
}
```
When I ran the code, the screen was just blank and black. I have searched the forum and did not seen a solution. Could someone find out why?
Thank you for reading this.