示例#1
0
func Init() {
	gocurses.Initscr()
	gocurses.Cbreak()
	gocurses.Noecho()
	gocurses.Stdscr.Keypad(true)
	gocurses.CursSet(0)
	if !gocurses.HasColors() {
		panic("No colors")
	}
	gocurses.StartColor()

	ConsoleHeight, ConsoleWidth = gocurses.Getmaxyx()
	ScreenHeight, ScreenWidth = Percent(85, ConsoleHeight), Percent(70, ConsoleWidth)
	StatsWindow = gocurses.NewWindow(ScreenHeight, ConsoleWidth-ScreenWidth, 0, ScreenWidth+1)

	debugWindow = gocurses.NewWindow(5, ConsoleWidth, ConsoleHeight-1, 1)
	MessageLog.pad = gocurses.NewPad(100, ScreenWidth)

	rand.Seed(time.Now().UnixNano())

	// Color pairs
	gocurses.InitPair(1, gocurses.COLOR_RED, gocurses.COLOR_BLACK)
}
示例#2
0
//Sets the GamePad and WH-WW info to the current area in the game object.
func SetPad(h, w int) {
	GamePad = gocurses.NewPad(h, w)
	WorldHeight, WorldWidth = h, w
}