@@ -123,40 +123,42 @@ namespace microcode {
123123 // app.pushScene(gcs)
124124
125125
126- // const buttonCollection = new ButtonCollection({
127- // alignment: GUIComponentAlignment.TOP,
128- // btns: [
129- // [ // Row 1:
130- // new Button({ icon: "accelerometer", ariaId: "0", onClick: () => basic.showNumber(0) }),
131- // new Button({ icon: "pin_0", ariaId: "1", onClick: () => basic.showNumber(1) }),
132- // new Button({ icon: "pin_1", ariaId: "2", onClick: () => basic.showNumber(2) }),
133- // new Button({ icon: "pin_2", ariaId: "3", onClick: () => basic.showNumber(3) }),
134- // ],
135- // [ // Row 2:
136- // new Button({ icon: "thermometer", ariaId: "4", onClick: () => basic.showNumber(4) }),
137- // new Button({ icon: "microphone", ariaId: "5", onClick: () => basic.showNumber(5) })
138- // ],
139- // [ // Row 3:
140- // new Button({ icon: "compass", ariaId: "6", onClick: () => basic.showNumber(6) }),
141- // new Button({ icon: "compass", ariaId: "6", onClick: () => basic.showNumber(6) }),
142- // new Button({ icon: "compass", ariaId: "6", onClick: () => basic.showNumber(6) }),
126+ const buttonCollection = new ButtonCollection ( {
127+ alignment : GUIComponentAlignment . TOP ,
128+ btns : [
129+ [ // Row 1:
130+ new Button ( { icon : "accelerometer" , ariaId : "0" , onClick : ( ) => basic . showNumber ( 0 ) } ) ,
131+ new Button ( { icon : "pin_0" , ariaId : "1" , onClick : ( ) => basic . showNumber ( 1 ) } ) ,
132+ new Button ( { icon : "pin_1" , ariaId : "2" , onClick : ( ) => basic . showNumber ( 2 ) } ) ,
133+ new Button ( { icon : "pin_2" , ariaId : "3" , onClick : ( ) => basic . showNumber ( 3 ) } ) ,
134+ ] ,
135+ [ // Row 2:
136+ new Button ( { icon : "thermometer" , ariaId : "4" , onClick : ( ) => basic . showNumber ( 4 ) } ) ,
137+ new Button ( { icon : "microphone" , ariaId : "5" , onClick : ( ) => basic . showNumber ( 5 ) } )
138+ ] ,
139+ [ // Row 3:
140+ new Button ( { icon : "compass" , ariaId : "6" , onClick : ( ) => basic . showNumber ( 6 ) } ) ,
141+ new Button ( { icon : "compass" , ariaId : "6" , onClick : ( ) => basic . showNumber ( 6 ) } ) ,
142+ new Button ( { icon : "compass" , ariaId : "6" , onClick : ( ) => basic . showNumber ( 6 ) } ) ,
143+ new Button ( { icon : "compass" , ariaId : "6" , onClick : ( ) => basic . showNumber ( 6 ) } ) ,
144+ new Button ( { icon : "compass" , ariaId : "6" , onClick : ( ) => basic . showNumber ( 6 ) } ) ,
143145
144- // ],
145- // [ // Row 4:
146- // new Button({ icon: "right_spin", ariaId: "7", onClick: () => basic.showNumber(7) }),
147- // new Button({ icon: "right_turn", ariaId: "8", onClick: () => basic.showNumber(8) }),
148- // new Button({ icon: "green_tick", ariaId: "9", onClick: () => basic.showNumber(9) })
149- // ],
150- // ],
151- // isActive: true,
152- // isHidden: false,
153- // xScaling: 1.1,
154- // yScaling: 1.9 ,
155- // colour: 3,
156- // })
146+ ] ,
147+ [ // Row 4:
148+ new Button ( { icon : "right_spin" , ariaId : "7" , onClick : ( ) => basic . showNumber ( 7 ) } ) ,
149+ new Button ( { icon : "right_turn" , ariaId : "8" , onClick : ( ) => basic . showNumber ( 8 ) } ) ,
150+ new Button ( { icon : "green_tick" , ariaId : "9" , onClick : ( ) => basic . showNumber ( 9 ) } )
151+ ] ,
152+ ] ,
153+ isActive : true ,
154+ isHidden : false ,
155+ xScaling : 1.1 ,
156+ yScaling : 1.7 ,
157+ colour : 3 ,
158+ } )
157159
158- // const gcs = new GUIComponentScene({ app, components: [buttonCollection] })
159- // app.pushScene(gcs)
160+ const gcs = new GUIComponentScene ( { app, components : [ buttonCollection ] } )
161+ app . pushScene ( gcs )
160162
161163
162164
@@ -214,21 +216,21 @@ namespace microcode {
214216
215217 // Example 6: RadioButtons
216218
217- const rbc = new RadioButtonCollection ( {
218- alignment : GUIComponentAlignment . TOP ,
219- btns : [
220- new RadioButton ( { text : "hi" , onClick : ( ) => { basic . showString ( "hi" ) } } ) ,
221- new RadioButton ( { text : "hiya" , onClick : ( ) => { basic . showString ( "hiya" ) } } ) ,
222- new RadioButton ( { text : "hello" , onClick : ( ) => { basic . showString ( "hello" ) } } ) ,
223- new RadioButton ( { text : "hello" , onClick : ( ) => { basic . showString ( "hello" ) } } )
224- ] ,
225- isActive : true ,
226- yScaling : 1.1 ,
227- // title: "The title",
228- colour : 3 ,
229- } )
219+ // const rbc = new RadioButtonCollection({
220+ // alignment: GUIComponentAlignment.TOP,
221+ // btns: [
222+ // new RadioButton({ text: "hi", onClick: () => { basic.showString("hi") } }),
223+ // new RadioButton({ text: "hiya", onClick: () => { basic.showString("hiya") } }),
224+ // new RadioButton({ text: "hello", onClick: () => { basic.showString("hello") } }),
225+ // new RadioButton({ text: "hello", onClick: () => { basic.showString("hello") } })
226+ // ],
227+ // isActive: true,
228+ // yScaling: 1.1,
229+ // // title: "The title",
230+ // colour: 3,
231+ // })
230232
231- const gcs = new GUIComponentScene ( { app, components : [ rbc ] } )
232- app . pushScene ( gcs )
233+ // const gcs = new GUIComponentScene({ app, components: [rbc] })
234+ // app.pushScene(gcs)
233235}
234236
0 commit comments