resolution sets
This commit is contained in:
@@ -2,6 +2,38 @@ package konstructor
|
||||
|
||||
import "image/color"
|
||||
|
||||
type ResolutionSet struct {
|
||||
Width int
|
||||
Height int
|
||||
}
|
||||
|
||||
var QVGAResolutionSet = ResolutionSet{
|
||||
Width: 320,
|
||||
Height: 240,
|
||||
}
|
||||
|
||||
var VGAResolutionSet = ResolutionSet{
|
||||
Width: 640,
|
||||
Height: 480,
|
||||
}
|
||||
|
||||
var SVGAResolutionSet = ResolutionSet{
|
||||
Width: 800,
|
||||
Height: 600,
|
||||
}
|
||||
|
||||
var XGAResolutionSet = ResolutionSet{
|
||||
Width: 1024,
|
||||
Height: 768,
|
||||
}
|
||||
|
||||
var ResolutionSets = []ResolutionSet{
|
||||
QVGAResolutionSet,
|
||||
VGAResolutionSet,
|
||||
SVGAResolutionSet,
|
||||
XGAResolutionSet,
|
||||
}
|
||||
|
||||
type KeyMap struct {
|
||||
Up any
|
||||
Down any
|
||||
@@ -30,3 +62,8 @@ type Config struct {
|
||||
Header *HeaderConfig
|
||||
KeyMap KeyMap
|
||||
}
|
||||
|
||||
func (c *Config) SetResolution(set ResolutionSet) {
|
||||
c.Screen.Width = set.Width
|
||||
c.Screen.Height = set.Height
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user