Custom menu

I'd like to increase the font size of the item labels in menu 2.

I've seen that “Toybox.WatchUi.CustomMenu” exists, but I haven't seen a clear example (I'm new) . Anyone have any ideas?

Thanks

Simon



  • C:\Users\<Username>\AppData\Roaming\Garmin\ConnectIQ\Sdks\connectiq-sdk-win-7.3.1-2024-09-23-df7b5816a\samples\Menu2Sample

    Custom Menu2 font

    samples\Menu2Sample\source\MenuSampleBasicCustom.mc

        //! Draw the item string at the center of the item.
        //! @param dc Device context
        public function draw(dc as Dc) as Void {
            var font = Graphics.FONT_SMALL;
            if (isFocused()) {
                font = Graphics.FONT_LARGE;
            }
    
            if (isSelected()) {
                dc.setColor(Graphics.COLOR_BLUE, Graphics.COLOR_BLUE);
                dc.clear();
            }
    
            dc.setColor(Graphics.COLOR_BLACK, Graphics.COLOR_TRANSPARENT);
            dc.drawText(dc.getWidth() / 2, dc.getHeight() / 2, font, _label, Graphics.TEXT_JUSTIFY_CENTER | Graphics.TEXT_JUSTIFY_VCENTER);
            dc.setColor(Graphics.COLOR_BLACK, Graphics.COLOR_BLACK);
            dc.drawLine(0, 0, dc.getWidth(), 0);
            dc.drawLine(0, dc.getHeight() - 1, dc.getWidth(), dc.getHeight() - 1);
        }



    samples/Menu2Sample at main · Garmin255/samples (github.com)

    I also push it on GitHub.

    github.com/.../samples