Пример #1
0
func draw() {
	image.DrawRect(go2d.NewRect(10, 10, 100, 100))

	image.Draw(10, 200)

	arial16.DrawText("Testing...", 200, 10)

	go2d.DrawFillRect(go2d.NewRect(350, 200, 100, 100), 255, 100, 0, 255)
}
Пример #2
0
func draw() {
	currentEnv.bg.DrawRect(go2d.NewRect(0, 0, 800, 600))
	font.SetStyle(false, false, true)
	currentEnv.customs.DrawRect(go2d.NewRect(300, 430, 164, 82))

	if !hatchOpen {
		currentEnv.hatch.DrawRect(go2d.NewRect(470, 480, 144, 80))
	} else {
		currentEnv.hatch_open.DrawRect(go2d.NewRect(470, 480, 144, 80))
	}

	//go2d.DrawFillRect(go2d.NewRect(320, 455, 80, 80), 255, 255, 255, 255)
	currentEnv.pole.DrawRect(go2d.NewRect(540, 280, 30, 160))
	borden[0].Draw(480, 260)
	for i := 0; i < len(humans); i++ {
		human := humans[i]
		if len(human.frames) > 0 {
			human.frames[human.frame].DrawInRect(humans[i].x, humans[i].y, go2d.NewRect(0, 0, 800, 512))
		}
	}
	currentEnv.seaker.DrawRect(go2d.NewRect(150, 309, 91, 211))

	currentEnv.entrance.DrawRect(go2d.NewRect(717, 311, 83, 176))
	font.SetStyle(true, false, false)
	font.DrawText("Body heat:", 100, 100)
	font.DrawText("Head:", 100, 120)
	font.DrawText("Upper body:", 100, 140)
	font.DrawText("Lower body:", 100, 160)
	font.DrawText(fmt.Sprintf("%d", temp_head), 200, 120)
	font.DrawText(fmt.Sprintf("%d", temp_upper), 200, 140)
	font.DrawText(fmt.Sprintf("%d", temp_lower), 200, 160)

	font.DrawText("Country:", 300, 100)
	if currentCountry != nil {
		font.DrawText(currentCountry.name, 300, 120)
	}

	font.DrawText("Possible diseases:", 500, 100)

	if currentDiseases != nil {
		counter := 0
		for _, disease := range currentDiseases {
			checks := ""
			if disease.head {
				checks = "H"
			}
			if disease.upper {
				if checks != "" {
					checks = checks + ":U"
				} else {
					checks = "U"
				}
			}
			if disease.lower {
				if checks != "" {
					checks = checks + ":L"
				} else {
					checks = "L"
				}
			}
			font.DrawText(disease.name+" ("+checks+")", 500, 120+(counter*20))
			counter++

			for i, dname := range epidemics {
				if dname == disease.name {
					borden[i+1].Draw(480, 260)
					break
				}
			}
		}
	}

	font.SetStyle(false, false, true)
}