Sub drawLetters
Dim i As Int
Dim schar As String
Dim cnt As Int = 0
Dim xPos As Int = 20
Dim yPos As Int = 200
Dim abcLen As Int = abc.length - 1
For i = 0 To abcLen
schar = abc.SubString2(i,i+1)
Dim btn As CreateJSShape
btn.initialize
btn.graphics.beginFill("#000")
btn.graphics.beginStroke("#000")
btn.graphics.drawRect(0, 0, 20, 24)
btn.regX(10)
btn.regY(12)
btn.setx(xPos)
btn.sety(yPos)
game.addChild(btn.Shape)
'create text
Dim txt As CreateJSText
txt.initialize1(schar)
txt.setcolor("#FFF")
txt.settextAlign("center")
txt.settextBaseline("middle")
txt.setx(xPos)
txt.sety(yPos)
game.addChild(txt.text)
'
btn.Settxt(txt.Text)
Dim e As BANanoEvent
btn.addEventListener("click", BANano.CallBack(Me, "onLetterClick", Array(e)))
'adjust positions
xPos = xPos + 24
cnt = cnt + 1
If (cnt = 13) Then
yPos = yPos + 30
xPos = 20
End If
Next
End Sub