Sub START_Show
'Create Start screen
Stage.Initialize("ST")
Dim CL As lgColor
cl.SetAlpha(1)
Table.Initialize("")
Table.debugColor = CL.BLUE
Table.debugCellColor = CL.BLUE
Table.Defaults.pad(3dip)
Table.setPosition(lGdx.Graphics.Width/2, lGdx.Graphics.Height/2)
Stage.AddActor(Table)
Dim npBtnUp As lgScn2DNinePatchDrawable
Dim npBtnDown As lgScn2DNinePatchDrawable
Dim stylTextButton As lgScn2DTextButtonStyle
Font.Initialize
Atlas.InitializeWithFile("atlas/uiskin.pack")
npBtnUp.Initialize2(Atlas.Create9Patch("default-round"))
npBtnDown.Initialize2(Atlas.Create9Patch("default-round-down"))
stylTextButton.Initialize(npBtnUp, npBtnDown, Font)
stylTextButton.SetDrawableSize(80%x, 30%y)
stylTextButton.FontColor = Font.Color.WHITE
stylTextButton.CheckedFontColor = Font.Color.YELLOW
stylTextButton.DisabledFontColor = Font.Color.GRAY
stylTextButton.DownFontColor = Font.Color.ORANGE
TextButtons(0).Initialize("START", stylTextButton, "TxtBtn")
TextButtons(0).Name = "TxtBtn" & 0
TextButtons(0).Tag = 0
Table.AddActor(TextButtons(0))
Table.NewRow
TextButtons(1).Initialize("PLAY", stylTextButton, "TxtBtn")
TextButtons(1).Name = "TxtBtn" & 1
TextButtons(1).Tag = 1
Table.AddActor(TextButtons(1))
Table.NewRow
TextButtons(2).Initialize("SETTINGS", stylTextButton, "TxtBtn")
TextButtons(2).Name = "TxtBtn" & 2
TextButtons(2).Tag = 3
Table.AddActor(TextButtons(2))
Table.NewRow
Log("Table X-Y: " & Table.X & ":" & Table.Y)
End Sub
Sub START_Update
End Sub
Sub START_Resize(Width As Int, Height As Int)
Stage.SetViewport(Width, Height, True)
End Sub
Sub START_Render(Delta As Float)
GL.glClearColor(0, 0, 0, 1)
GL.glClear(GL.GL10_COLOR_BUFFER_BIT)
'Applies the actions to actors
Stage.Act
'Draws the buttons
Stage.Draw
End Sub
Sub START_Pause
'save game data
End Sub
Sub START_Resume
End Sub
Sub START_Hide
'For i=0 To TextButtons.Length-1
' TextButtons(i).clearListeners
'Next
Stage.Clear
Stage.dispose
Font.dispose
Atlas.dispose
Log("Hide Start")
End Sub
Sub TxtBtn_Click(CheckedState As Boolean)
If lGdx_ScrMgr.CurrentScreen = lGdx_Screen(0) Then
Dim Bt As lgScn2DTextButton = Sender
lGdx_ScrMgr.CurrentScreen = lGdx_Screen(Bt.Tag)
End If
End Sub