Help for a beginner

Former Member
Former Member

Hi all,

I'm just staring with Garmin development and I need a quick help.

I've been reading some articles and watching some videos on YT to learn.

I'm just trying to change the background colour and write a simple text, but it's not working.
Background remains black and it just shows the time on the screen.

What am I doing wrong?

Tanks in advance.

    // Load your resources here
    function onLayout(dc) {
        setLayout(Rez.Layouts.WatchFace(dc));
    }

    // Called when this View is brought to the foreground. Restore
    // the state of this View and prepare it to be shown. This includes
    // loading resources into memory.
    function onShow() {
    }

    // Update the view
    function onUpdate(dc) {
        dc.setColor(Graphics.COLOR_WHITE, Graphics.COLOR_WHITE);
        dc.clear();
        
        dc.setColor(Graphics.COLOR_RED, Graphics.COLOR_WHITE);
        dc.drawText(50, 50, Graphics.FONT_LARGE, "Test Text", Graphics.TEXT_JUSTIFY_LEFT);
        
        // Get and show the current time
        var clockTime = System.getClockTime();
        var timeString = Lang.format("$1$:$2$:00", [clockTime.hour, clockTime.min.format("%02d")]);
        var view = View.findDrawableById("TimeLabel");
        view.setText(timeString);

        // Call the parent onUpdate function to redraw the layout
        View.onUpdate(dc);
    }