Documentation
¶
Index ¶
- Constants
- Variables
- func BackGroundColor() *color.NRGBA
- func BoxFilledColor(turn int) *color.NRGBA
- func BoxTipsColor() *color.NRGBA
- func ButtonColor() *color.NRGBA
- func ConversionColor() *color.NRGBA
- func DotCanvasColor() *color.NRGBA
- func EdgeHighlightColor(turn int) *color.NRGBA
- func GetColor(lightColor, darkColor *color.NRGBA) *color.NRGBA
- func NewBoxCanvas(b model.Box) *canvas.Rectangle
- func NewButtonCanvas(e model.Edge, tapped func()) *widget.Button
- func NewDotCanvas(d model.Dot, c color.Color) *canvas.Circle
- func NewEdgeCanvas(e model.Edge, c color.Color) *canvas.Line
- func Restart()
- func ShowConversionAnimation()
- func ShowIntroduceInterface()
- func ShowSettingFormDialog() *dialog.FormDialog
- func ShowStartMenu()
- func SpinnerCanvas() *canvas.Image
- func StartMenuBackgroundColor() *color.NRGBA
- func TextColor() color.Color
- type CenterLayout
- type FyneDefaultTheme
- type GameInterface
- func (game *GameInterface) Add(e model.Edge)
- func (game *GameInterface) Close()
- func (game *GameInterface) CurrentBoard() *board.BoardV2
- func (game *GameInterface) Gaming() bool
- func (game *GameInterface) GetUserEdge() model.Edge
- func (game *GameInterface) Lock()
- func (game *GameInterface) RemoveHighlight()
- func (game *GameInterface) ScoreLabel() *widget.Label
- func (game *GameInterface) Unlock()
- type GameTheme
- type StartMenuTheme
Constants ¶
Variables ¶
View Source
var ( MainWindow = app.NewWithID("io.github.dotsandboxes").NewWindow("Dots and Boxes") ThemeVariant = fyne.CurrentApp().Settings().ThemeVariant() )
View Source
var ( LightThemeDotCanvasColor = &color.NRGBA{R: 255, G: 255, B: 255, A: 255} DarkThemeDotCanvasColor = &color.NRGBA{R: 202, G: 202, B: 202, A: 255} LightThemeGameInterfaceBackGroundColor = &color.NRGBA{R: 242, G: 242, B: 242, A: 255} DarkThemeGameInterfaceBackGroundColor = &color.NRGBA{R: 43, G: 43, B: 43, A: 255} LightThemeEmptyEdgeColor = &color.NRGBA{R: 217, G: 217, B: 217, A: 255} DarkThemeEmptyEdgeColor = &color.NRGBA{R: 65, G: 65, B: 65, A: 255} Player1EdgeHighlightColor = &color.NRGBA{R: 64, G: 64, B: 255, A: 255} Player2EdgeHighlightColor = &color.NRGBA{R: 255, G: 64, B: 64, A: 255} LightThemeScoreableTipsColor = &color.NRGBA{R: 250, G: 250, B: 200, A: 255} DarkThemeScoreableTipsColor = &color.NRGBA{R: 65, G: 65, B: 15, A: 255} Player1BoxFilledColor = &color.NRGBA{R: 64, G: 64, B: 255, A: 64} Player2BoxFilledColor = &color.NRGBA{R: 255, G: 64, B: 64, A: 64} LightThemeConversionColor = &color.NRGBA{R: 252, G: 252, B: 252, A: 255} DarkThemeConversionColor = &color.NRGBA{R: 33, G: 33, B: 33, A: 255} DarkThemeStartMenuBackgroundColor = &color.NRGBA{R: 16, G: 16, B: 16, A: 255} LightThemeStartMenuBackgroundColor = &color.NRGBA{R: 255, G: 255, B: 255, A: 255} LinkColor = &color.NRGBA{R: 73, G: 148, B: 236, A: 255} )
View Source
var ( Icon = fyne.NewStaticResource("Icon", gen.Icon) TimesNewRomanItalic = fyne.NewStaticResource("TimesNewRomanItalic", gen.TimesNewRomanItalic) TimesNewRomanBold = fyne.NewStaticResource("TimesNewRomanBold", gen.TimesNewRomanBold) )
View Source
var Spinning bool
Functions ¶
func BackGroundColor ¶
func BoxFilledColor ¶
func BoxTipsColor ¶
func ButtonColor ¶
func ConversionColor ¶
func DotCanvasColor ¶
func EdgeHighlightColor ¶
func ShowConversionAnimation ¶
func ShowConversionAnimation()
func ShowIntroduceInterface ¶
func ShowIntroduceInterface()
func ShowSettingFormDialog ¶
func ShowSettingFormDialog() *dialog.FormDialog
func ShowStartMenu ¶
func ShowStartMenu()
func SpinnerCanvas ¶
Types ¶
type CenterLayout ¶
func (*CenterLayout) Layout ¶
func (l *CenterLayout) Layout(objects []fyne.CanvasObject, size fyne.Size)
func (*CenterLayout) MinSize ¶
func (l *CenterLayout) MinSize([]fyne.CanvasObject) fyne.Size
type FyneDefaultTheme ¶
type FyneDefaultTheme struct{}
func (*FyneDefaultTheme) Icon ¶
func (t *FyneDefaultTheme) Icon(icon fyne.ThemeIconName) fyne.Resource
func (*FyneDefaultTheme) Size ¶
func (t *FyneDefaultTheme) Size(name fyne.ThemeSizeName) float32
type GameInterface ¶
type GameInterface struct {
Board board.BoardV2
DotCanvases [model.MaxDot]canvas.Circle
EdgeCanvases [model.MaxEdge]canvas.Line
EdgeAnimation [model.MaxEdge]*fyne.Animation
EdgeLastColor [model.MaxEdge]color.NRGBA
BoxCanvases [model.MaxBox]canvas.Rectangle
BoxAnimation [model.MaxBox]*fyne.Animation
BoxTipped [model.MaxBox]bool
Buttons [model.MaxEdge]widget.Button
UserInputEdge model.Edge
LastEdge model.Edge
Container *fyne.Container
PauseDialog *dialog.CustomDialog
GameOverDialog *dialog.ConfirmDialog
End bool
Paused bool
}
func NewGameInterface ¶
func NewGameInterface() *GameInterface
func (*GameInterface) Add ¶
func (game *GameInterface) Add(e model.Edge)
func (*GameInterface) Close ¶
func (game *GameInterface) Close()
func (*GameInterface) CurrentBoard ¶
func (game *GameInterface) CurrentBoard() *board.BoardV2
func (*GameInterface) Gaming ¶
func (game *GameInterface) Gaming() bool
func (*GameInterface) GetUserEdge ¶
func (game *GameInterface) GetUserEdge() model.Edge
func (*GameInterface) Lock ¶
func (game *GameInterface) Lock()
func (*GameInterface) RemoveHighlight ¶
func (game *GameInterface) RemoveHighlight()
func (*GameInterface) ScoreLabel ¶
func (game *GameInterface) ScoreLabel() *widget.Label
func (*GameInterface) Unlock ¶
func (game *GameInterface) Unlock()
type GameTheme ¶
type GameTheme struct {
FyneDefaultTheme
}
func (*GameTheme) Color ¶
func (t *GameTheme) Color(name fyne.ThemeColorName, variant fyne.ThemeVariant) color.Color
type StartMenuTheme ¶
type StartMenuTheme struct {
FyneDefaultTheme
}
func (*StartMenuTheme) Color ¶
func (s *StartMenuTheme) Color(name fyne.ThemeColorName, variant fyne.ThemeVariant) color.Color
Click to show internal directories.
Click to hide internal directories.