Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/JoelOtter/termloop
/ functions
Functions
152 in github.com/JoelOtter/termloop
⨍
Functions
152
◇
Types & classes
33
↓ 23 callers
Method
Screen
Screen returns the current Screen of a Game.
game.go:29
↓ 18 callers
Method
SetPosition
SetPosition sets the coordinates of the Text to be (x, y).
text.go:54
↓ 11 callers
Method
Position
()
termloop.go:80
↓ 10 callers
Method
AddEntity
(Drawable)
level.go:7
↓ 10 callers
Method
Start
Start starts a Game running. This should be the last thing called in your main function. By default, the escape key exits.
game.go:79
↓ 9 callers
Method
Draw
(*Screen)
level.go:9
↓ 8 callers
Method
SetFps
Set the screen framerate. By default, termloop will draw the the screen as fast as possible, which may use a lot of system resources.
screen.go:125
↓ 7 callers
Method
AddEntity
AddEntity adds Drawable d to the level's entities.
level.go:83
↓ 6 callers
Method
Size
Return position, x and y
termloop.go:81
↓ 5 callers
Method
Tick
(Event)
level.go:10
↓ 4 callers
Function
NewCanvas
NewCanvas returns a new Canvas, with width and height defined by arguments.
termloop.go:15
↓ 4 callers
Method
SetCell
SetCell updates the attribute of the Cell at x, y to match those of c. The coordinates are relative to the entity itself, not the Screen.
entity.go:68
↓ 4 callers
Method
SetLevel
SetLevel sets the Screen's current level to be l.
screen.go:92
↓ 4 callers
Function
min
(a, b int)
termloop.go:92
↓ 4 callers
Function
renderCell
(old, new_ *Cell)
screen.go:154
↓ 3 callers
Method
ApplyCanvas
ApplyCanvas takes a pointer to a Canvas, c, and applies this canvas over the top of the Entity's canvas. Any new values in c will overwrite those in t
entity.go:85
↓ 3 callers
Method
Color
Color returns the (foreground, background) colors of the Text.
text.go:75
↓ 3 callers
Method
RenderCell
RenderCell updates the Cell at a given position on the Screen with the attributes in Cell c.
screen.go:131
↓ 3 callers
Method
SetColor
SetColor sets the (foreground, background) colors of the Text to fg, bg respectively.
text.go:81
↓ 3 callers
Function
cubeIndex
(x int, points [5]int)
util.go:40
↓ 3 callers
Method
resize
(w, h int)
screen.go:69
↓ 2 callers
Method
Log
Log takes a log string and additional parameters, which can be substituted into the string using standard fmt.Printf rules. The formatted string is ad
game.go:53
↓ 2 callers
Function
NewCollRec
(x, y, w, h int, color tl.Attr, move bool)
_examples/collision.go:12
↓ 2 callers
Function
NewText
NewText creates a new Text, at position (x, y). It sets the Text's background and foreground colors to fg and bg respectively, and sets the Text's tex
text.go:17
↓ 2 callers
Method
SetOffset
SetOffset sets the level's drawing offset to be (x, y). The drawing offset can be used to simulate moving the level, or moving the 'camera'.
level.go:105
↓ 2 callers
Method
SetText
SetText sets the text of the Text to be text.
text.go:65
↓ 2 callers
Method
Stop
Stop shuts down PortAudio
extra/audio.go:54
↓ 2 callers
Method
TimeDelta
TimeDelta returns the number of seconds since the previous frame was rendered. Can be used for timings and animation.
screen.go:118
↓ 2 callers
Function
adjacents
(point *Point, maze [][]rune)
_examples/pyramid.go:30
↓ 2 callers
Function
buildLevel
(g *tl.Game, w, h, score int)
_examples/pyramid.go:171
↓ 2 callers
Function
checkErr
(err error)
_examples/levelmap.go:44
↓ 2 callers
Function
chk
(err error)
_examples/audio.go:11
↓ 2 callers
Function
colorGridFromFile
Image processing
image.go:14
↓ 2 callers
Method
equals
(c2 *Cell)
termloop.go:116
↓ 2 callers
Function
isInMaze
(x, y int, w, h int)
_examples/pyramid.go:48
↓ 2 callers
Method
setOffset
(x, y int)
screen.go:150
↓ 1 callers
Function
BackgroundCanvasFromFile
BackgroundCanvasFromFile takes a path to an image file, and creates a canvas of background-only Cells representing the image. This can be applied to a
image.go:51
↓ 1 callers
Function
CanvasFromString
CanvasFromString returns a new Canvas, built from the characters in the string str. Newline characters in the string are interpreted as a new Canvas r
termloop.go:49
↓ 1 callers
Method
Collide
Return width and height
termloop.go:89
↓ 1 callers
Function
CreateSoundCtrl
(filename string, loop bool)
_examples/audio.go:23
↓ 1 callers
Method
DrawBackground
(*Screen)
level.go:6
↓ 1 callers
Method
EnablePixelMode
EnablePixelMode sets the screen to 'pixel mode' - giving double the canvas height while sacrificing character drawing ability.
screen.go:142
↓ 1 callers
Function
ForegroundCanvasFromFile
ForegroundCanvasFromFile takes a path to an image file, and creates a canvas of foreground-only Cells representing the image. This can be applied to a
image.go:66
↓ 1 callers
Method
Level
Level returns the Screen's current level.
screen.go:97
↓ 1 callers
Method
LoadTrack
LoadTrack reads an audio track from a file, and returns a pointer to a Track struct, or an error. The boolean parameter 'loop' determines whether or n
extra/audio.go:86
↓ 1 callers
Function
NewBlock
(x, y int, color tl.Attr, g *tl.Game, w, h, score int, scoretext *tl.Text)
_examples/pyramid.go:116
↓ 1 callers
Function
NewClickable
(x, y, w, h int, col tl.Attr)
_examples/click.go:44
↓ 1 callers
Function
NewEntityFromCanvas
NewEntityFromCanvas returns a pointer to a new Entity, with position (x, y) and Canvas c. Width and height are calculated using the Canvas.
entity.go:25
↓ 1 callers
Function
NewEventInfo
(x, y int)
_examples/click.go:12
↓ 1 callers
Function
NewImage
(c *tl.Canvas)
_examples/image.go:15
↓ 1 callers
Function
NewRectangle
NewRectangle creates a new Rectangle at position (x, y), with size (width, height) and color color. Returns a pointer to the new Rectangle.
rectangle.go:15
↓ 1 callers
Function
NewScreen
NewScreen creates a new Screen, with no entities or level. Returns a pointer to the new Screen.
screen.go:24
↓ 1 callers
Method
Opposite
()
_examples/pyramid.go:20
↓ 1 callers
Method
Pause
Pause stops a Track playing, but does not reset its position. The track can be resumed by calling Play().
extra/audio.go:125
↓ 1 callers
Method
Play
Play triggers a Track to start playing.
extra/audio.go:113
↓ 1 callers
Method
Restart
Restart resets the Track to the beginning but does not stop playback.
extra/audio.go:130
↓ 1 callers
Function
RgbTo256Color
RgbTo256Color takes RGB values and returns the closest color for a 256-color terminal, as an Attr type.
util.go:54
↓ 1 callers
Method
SetDebugOn
SetDebugOn sets debug mode's on status to be debugOn.
game.go:45
↓ 1 callers
Method
Size
Size returns the width and height of the Text.
text.go:49
↓ 1 callers
Function
check
(e error)
_examples/entityfromfile.go:8
↓ 1 callers
Function
checkCollisionsWorker
(ps []Physical, jobs <-chan DynamicPhysical, results chan<- int)
level.go:109
↓ 1 callers
Function
convertEvent
(ev termbox.Event)
termloop.go:135
↓ 1 callers
Method
dumpLogs
()
game.go:59
↓ 1 callers
Function
generateMaze
Generates a maze using Prim's Algorithm https://en.wikipedia.org/wiki/Maze_generation_algorithm#Randomized_Prim.27s_algorithm
_examples/pyramid.go:55
↓ 1 callers
Function
max
(a, b int)
termloop.go:99
↓ 1 callers
Function
newInput
()
input.go:11
↓ 1 callers
Method
offset
()
screen.go:146
↓ 1 callers
Function
parseEntity
(data map[string]interface{})
map.go:38
↓ 1 callers
Function
parseRectangle
(data map[string]interface{})
map.go:18
↓ 1 callers
Function
parseText
(data map[string]interface{})
map.go:28
↓ 1 callers
Function
poll
(i *input)
input.go:26
↓ 1 callers
Method
start
()
input.go:18
↓ 1 callers
Method
stop
()
input.go:22
↓ 1 callers
Function
termboxNormal
(canvas *Canvas)
screen.go:183
↓ 1 callers
Function
termboxPixel
(canvas *Canvas)
screen.go:166
Method
AddEntity
AddEntity adds a Drawable to the current Screen, to be rendered.
screen.go:102
Method
Collide
(p tl.Physical)
_examples/collision.go:36
Method
Collide
(c tl.Physical)
_examples/pyramid.go:156
Method
Collide
(collision tl.Physical)
_examples/tutorial.go:35
Method
Color
Color returns the color of the Rectangle.
rectangle.go:54
Method
DebugOn
DebugOn returns a bool showing whether or not debug mode is on.
game.go:40
Method
Draw
Draw is called every frame by the Game to render the current state of the screen.
screen.go:46
Method
Draw
Draw draws the Text to the Screen s.
text.go:36
Method
Draw
Draws the Rectangle r onto Screen s.
rectangle.go:21
Method
Draw
Draw draws the level's entities to the Screen s.
level.go:73
Method
Draw
Method for processing events, e.g. input
termloop.go:73
Method
Draw
Draw updates the framerate on the FpsText and draws it to the Screen s.
util.go:30
Method
Draw
Draw draws the entity to its current position on the screen. This is usually called every frame.
entity.go:38
Method
Draw
(s *tl.Screen)
_examples/pyramid.go:128
Method
Draw
(s *tl.Screen)
_examples/image.go:21
Method
Draw
(s *tl.Screen)
_examples/audio.go:40
Method
Draw
(screen *tl.Screen)
_examples/tutorial.go:12
Method
DrawBackground
DrawBackground draws the background Cell bg to each Cell of the Screen s.
level.go:64
Method
Fill
Fill fills the canvas of the Entity with a Cell c.
entity.go:74
Function
InitAudio
InitAudio starts up PortAudio, creates a stream and returns a pointer to an Audio struct, or an error.
extra/audio.go:34
Function
LoadLevelFromMap
LoadLevelFromMap can be used to populate a Level with entities, given a JSON string to read from (jsonMap). The map 'parsers' is a map of entity name
map.go:75
Method
Looping
Looping returns whether or not the Track is set to loop.
extra/audio.go:145
Function
NewBaseLevel
NewBaseLevel creates a new BaseLevel with background bg. Returns a pointer to the new BaseLevel.
level.go:24
Function
NewEntity
NewEntity creates a new Entity, with position (x, y) and size (width, height). Returns a pointer to the new Entity.
entity.go:15
Function
NewFpsText
NewFpsText creates a new FpsText at position (x, y) and with background and foreground colors fg and bg respectively. It will refresh every 'update' s
util.go:21
next →
1–100 of 152, ranked by callers