1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-11-06 18:27:20 -05:00
OpenDiablo2/d2game/d2gamescreen/gui_testing.go
2020-06-24 22:41:18 -04:00

52 lines
1.7 KiB
Go

package d2gamescreen
import (
"github.com/OpenDiablo2/OpenDiablo2/d2core/d2gui"
"github.com/OpenDiablo2/OpenDiablo2/d2core/d2render"
"github.com/OpenDiablo2/OpenDiablo2/d2core/d2screen"
)
type GuiTestMain struct{}
func CreateGuiTestMain() *GuiTestMain {
return &GuiTestMain{}
}
func (g *GuiTestMain) OnLoad(loading d2screen.LoadingState) {
layout := d2gui.CreateLayout(d2gui.PositionTypeHorizontal)
loading.Progress(0.3)
//
layoutLeft := layout.AddLayout(d2gui.PositionTypeVertical)
layoutLeft.SetHorizontalAlign(d2gui.HorizontalAlignCenter)
layoutLeft.AddLabel("FontStyle16Units", d2gui.FontStyle16Units)
layoutLeft.AddSpacerStatic(0, 100)
layoutLeft.AddLabel("FontStyle30Units", d2gui.FontStyle30Units)
layoutLeft.AddLabel("FontStyle42Units", d2gui.FontStyle42Units)
layoutLeft.AddLabel("FontStyleFormal10Static", d2gui.FontStyleFormal10Static)
layoutLeft.AddLabel("FontStyleFormal11Units", d2gui.FontStyleFormal11Units)
layoutLeft.AddLabel("FontStyleFormal12Static", d2gui.FontStyleFormal12Static)
loading.Progress(0.6)
layout.AddSpacerDynamic()
layoutRight := layout.AddLayout(d2gui.PositionTypeVertical)
layoutRight.SetHorizontalAlign(d2gui.HorizontalAlignRight)
layoutRight.AddButton("Medium", d2gui.ButtonStyleMedium)
layoutRight.AddButton("Narrow", d2gui.ButtonStyleNarrow)
layoutRight.AddButton("OkCancel", d2gui.ButtonStyleOkCancel)
layoutRight.AddButton("Short", d2gui.ButtonStyleShort)
layoutRight.AddButton("Wide", d2gui.ButtonStyleWide)
loading.Progress(0.9)
layout.SetVerticalAlign(d2gui.VerticalAlignMiddle)
d2gui.SetLayout(layout)
}
func (g *GuiTestMain) Render(screen d2render.Surface) error {
return nil
}
func (g *GuiTestMain) Advance(tickTime float64) error {
return nil
}