func main() { rog.Open(width, height, "Example") for rog.IsOpen() { example() rog.Flush() } }
func main() { rog.Open(40, 20, 1, false, "pathfinding", nil) for rog.Running() { if rog.Mouse().Left.Released { limit := image.Rect(0, 0, 40, 20) target := image.Pt(rog.Mouse().Cell.X, rog.Mouse().Cell.Y) path = rog.Path(level, limit, level.player, target) } for y := 0; y < 20; y++ { for x := 0; x < 40; x++ { rog.Set(x, y, nil, nil, string(level.data[y][x])) } } rog.Set(level.player.X, level.player.Y, nil, nil, "@") for _, p := range path { if p.X != level.player.X || p.Y != level.player.Y { rog.Set(p.X, p.Y, rog.Red, nil, "*") } } if rog.Key() == rog.Esc { rog.Close() } rog.Flush() } }
func main() { rog.Open(width, height, 1, false, "Example", nil) for rog.Running() { example() rog.Flush() } }
func main() { rog.Open(20, 11, 1, false, "rog", nil) for rog.Running() { rog.Set(5, 5, nil, nil, "Hello, 世界!") if rog.Key() == rog.Esc { rog.Close() } rog.Flush() } }
func main() { rog.Open(width, height+2, 1, false, "Perlin-noise Test", nil) for rog.Running() { render() rog.Set(0, height+1, nil, nil, "%v", rog.Fps()) if rog.Key() == rog.Esc { rog.Close() } rog.Flush() } }
func main() { rog.Open(width, height+2, 1, false, "tcod true color", nil) for rog.Running() { render() rog.Set(0, height+1, nil, nil, "%v", rog.Fps()) if rog.Key() == rog.Esc { rog.Close() } rog.Flush() } }
func main() { rog.Open(20, 10, 2, false, "scales", nil) rog.Set(0, 3, rog.Burn(rog.Grey), drainbow, " Discrete Scale ") rog.Set(0, 6, rog.Burn(rog.Grey), lrainbow, " Linear Scale ") for rog.Running() { rog.Set(0, 9, nil, nil, "%v", rog.Fps()) if rog.Key() == rog.Esc { rog.Close() } rog.Flush() } }
func main() { font := rog.Font("terminal1-2.png", 8, 16, "!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ ✵웃世界¢¥¤§©¨«¬£ª±²³´¶·¸¹º»¼½¾¿☐☑═║╔╗╚╝╠╣╦╩╬░▒▓☺☻☼♀♂▀▁▂▃▄▅▆▇█ÐÑÒÓÔÕÖÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏØÙÚÛÜÝàáâãäåèéêëìíîïðñòóôõö÷ùúûüýÿ♥♦♣♠♪♬æçø←↑→↓↔↕®‼ꀥ") rog.Open(80, 20, 2, false, "font", font) for i := 0; i < 20; i++ { rog.Set(30, i, rog.Black, rog.White, "12345abcdeABCDE!\"#$%") } for rog.Running() { if rog.Key() == rog.Esc { rog.Close() } rog.Flush() } }