import Toybox.Graphics; import Toybox.WatchUi; import Toybox.Lang; public var kjr as String = "88:88"; class hockeyTimerView extends WatchUi.View { function initialize() { View.initialize(); } // Load your resources here function onLayout(dc as Dc) as Void { // setLayout($.Rez.Layouts.MainLayout(dc)); $.setColourTheme(1); } // 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() as Void { } // Update the view function onUpdate(dc as Dc) as Void { var _colourBG = $.gColours[background] ; // var _colourTextBG = $.gColours[timerBg]; var _colourText = $.gColours[timer]; dc.setColor(_colourText, _colourBG); dc.clear(); dc.drawText(dc.getWidth()/2, dc.getHeight()/3, Graphics.FONT_MEDIUM, kjr, Graphics.TEXT_JUSTIFY_CENTER); } // Called when this View is removed from the screen. Save the // state of this View here. This includes freeing resources from // memory. function onHide() as Void { } // private function drawPeriodTimer(dc as Dc){ // _MM = $.gMatch.periods[$.gMatch.period].remaining/60; // _SS = $.gMatch.periods[$.gMatch.period].remaining%60; // _TM = Lang.format("$1$:$2$",[_MM.format("%02d"),_SS.format("%02d")]); // dc.setColor(_colourTextBG, Graphics.COLOR_TRANSPARENT); // dc.drawText($.gX, $.gY, $.gFontTimer, "88:88", Graphics.TEXT_JUSTIFY_VCENTER | Graphics.TEXT_JUSTIFY_CENTER); // dc.setColor(_colourText, Graphics.COLOR_TRANSPARENT); // dc.setPenWidth(2); // dc.drawLine(60,$.gY - 55,330,$.gY - 55); // dc.drawLine(60,$.gY + 56,330,$.gY + 56); // dc.drawText($.gX, $.gY, $.gFontTimer, _TM, Graphics.TEXT_JUSTIFY_VCENTER | Graphics.TEXT_JUSTIFY_CENTER); // } }