MCPcopy Create free account

hub / github.com/JoelOtter/termloop / functions

Functions152 in github.com/JoelOtter/termloop

↓ 23 callersMethodScreen
Screen returns the current Screen of a Game.
game.go:29
↓ 18 callersMethodSetPosition
SetPosition sets the coordinates of the Text to be (x, y).
text.go:54
↓ 11 callersMethodPosition
()
termloop.go:80
↓ 10 callersMethodAddEntity
(Drawable)
level.go:7
↓ 10 callersMethodStart
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 callersMethodDraw
(*Screen)
level.go:9
↓ 8 callersMethodSetFps
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 callersMethodAddEntity
AddEntity adds Drawable d to the level's entities.
level.go:83
↓ 6 callersMethodSize
Return position, x and y
termloop.go:81
↓ 5 callersMethodTick
(Event)
level.go:10
↓ 4 callersFunctionNewCanvas
NewCanvas returns a new Canvas, with width and height defined by arguments.
termloop.go:15
↓ 4 callersMethodSetCell
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 callersMethodSetLevel
SetLevel sets the Screen's current level to be l.
screen.go:92
↓ 4 callersFunctionmin
(a, b int)
termloop.go:92
↓ 4 callersFunctionrenderCell
(old, new_ *Cell)
screen.go:154
↓ 3 callersMethodApplyCanvas
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 callersMethodColor
Color returns the (foreground, background) colors of the Text.
text.go:75
↓ 3 callersMethodRenderCell
RenderCell updates the Cell at a given position on the Screen with the attributes in Cell c.
screen.go:131
↓ 3 callersMethodSetColor
SetColor sets the (foreground, background) colors of the Text to fg, bg respectively.
text.go:81
↓ 3 callersFunctioncubeIndex
(x int, points [5]int)
util.go:40
↓ 3 callersMethodresize
(w, h int)
screen.go:69
↓ 2 callersMethodLog
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 callersFunctionNewCollRec
(x, y, w, h int, color tl.Attr, move bool)
_examples/collision.go:12
↓ 2 callersFunctionNewText
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 callersMethodSetOffset
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 callersMethodSetText
SetText sets the text of the Text to be text.
text.go:65
↓ 2 callersMethodStop
Stop shuts down PortAudio
extra/audio.go:54
↓ 2 callersMethodTimeDelta
TimeDelta returns the number of seconds since the previous frame was rendered. Can be used for timings and animation.
screen.go:118
↓ 2 callersFunctionadjacents
(point *Point, maze [][]rune)
_examples/pyramid.go:30
↓ 2 callersFunctionbuildLevel
(g *tl.Game, w, h, score int)
_examples/pyramid.go:171
↓ 2 callersFunctioncheckErr
(err error)
_examples/levelmap.go:44
↓ 2 callersFunctionchk
(err error)
_examples/audio.go:11
↓ 2 callersFunctioncolorGridFromFile
Image processing
image.go:14
↓ 2 callersMethodequals
(c2 *Cell)
termloop.go:116
↓ 2 callersFunctionisInMaze
(x, y int, w, h int)
_examples/pyramid.go:48
↓ 2 callersMethodsetOffset
(x, y int)
screen.go:150
↓ 1 callersFunctionBackgroundCanvasFromFile
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 callersFunctionCanvasFromString
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 callersMethodCollide
Return width and height
termloop.go:89
↓ 1 callersFunctionCreateSoundCtrl
(filename string, loop bool)
_examples/audio.go:23
↓ 1 callersMethodDrawBackground
(*Screen)
level.go:6
↓ 1 callersMethodEnablePixelMode
EnablePixelMode sets the screen to 'pixel mode' - giving double the canvas height while sacrificing character drawing ability.
screen.go:142
↓ 1 callersFunctionForegroundCanvasFromFile
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 callersMethodLevel
Level returns the Screen's current level.
screen.go:97
↓ 1 callersMethodLoadTrack
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 callersFunctionNewBlock
(x, y int, color tl.Attr, g *tl.Game, w, h, score int, scoretext *tl.Text)
_examples/pyramid.go:116
↓ 1 callersFunctionNewClickable
(x, y, w, h int, col tl.Attr)
_examples/click.go:44
↓ 1 callersFunctionNewEntityFromCanvas
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 callersFunctionNewEventInfo
(x, y int)
_examples/click.go:12
↓ 1 callersFunctionNewImage
(c *tl.Canvas)
_examples/image.go:15
↓ 1 callersFunctionNewRectangle
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 callersFunctionNewScreen
NewScreen creates a new Screen, with no entities or level. Returns a pointer to the new Screen.
screen.go:24
↓ 1 callersMethodOpposite
()
_examples/pyramid.go:20
↓ 1 callersMethodPause
Pause stops a Track playing, but does not reset its position. The track can be resumed by calling Play().
extra/audio.go:125
↓ 1 callersMethodPlay
Play triggers a Track to start playing.
extra/audio.go:113
↓ 1 callersMethodRestart
Restart resets the Track to the beginning but does not stop playback.
extra/audio.go:130
↓ 1 callersFunctionRgbTo256Color
RgbTo256Color takes RGB values and returns the closest color for a 256-color terminal, as an Attr type.
util.go:54
↓ 1 callersMethodSetDebugOn
SetDebugOn sets debug mode's on status to be debugOn.
game.go:45
↓ 1 callersMethodSize
Size returns the width and height of the Text.
text.go:49
↓ 1 callersFunctioncheck
(e error)
_examples/entityfromfile.go:8
↓ 1 callersFunctioncheckCollisionsWorker
(ps []Physical, jobs <-chan DynamicPhysical, results chan<- int)
level.go:109
↓ 1 callersFunctionconvertEvent
(ev termbox.Event)
termloop.go:135
↓ 1 callersMethoddumpLogs
()
game.go:59
↓ 1 callersFunctiongenerateMaze
Generates a maze using Prim's Algorithm https://en.wikipedia.org/wiki/Maze_generation_algorithm#Randomized_Prim.27s_algorithm
_examples/pyramid.go:55
↓ 1 callersFunctionmax
(a, b int)
termloop.go:99
↓ 1 callersFunctionnewInput
()
input.go:11
↓ 1 callersMethodoffset
()
screen.go:146
↓ 1 callersFunctionparseEntity
(data map[string]interface{})
map.go:38
↓ 1 callersFunctionparseRectangle
(data map[string]interface{})
map.go:18
↓ 1 callersFunctionparseText
(data map[string]interface{})
map.go:28
↓ 1 callersFunctionpoll
(i *input)
input.go:26
↓ 1 callersMethodstart
()
input.go:18
↓ 1 callersMethodstop
()
input.go:22
↓ 1 callersFunctiontermboxNormal
(canvas *Canvas)
screen.go:183
↓ 1 callersFunctiontermboxPixel
(canvas *Canvas)
screen.go:166
MethodAddEntity
AddEntity adds a Drawable to the current Screen, to be rendered.
screen.go:102
MethodCollide
(p tl.Physical)
_examples/collision.go:36
MethodCollide
(c tl.Physical)
_examples/pyramid.go:156
MethodCollide
(collision tl.Physical)
_examples/tutorial.go:35
MethodColor
Color returns the color of the Rectangle.
rectangle.go:54
MethodDebugOn
DebugOn returns a bool showing whether or not debug mode is on.
game.go:40
MethodDraw
Draw is called every frame by the Game to render the current state of the screen.
screen.go:46
MethodDraw
Draw draws the Text to the Screen s.
text.go:36
MethodDraw
Draws the Rectangle r onto Screen s.
rectangle.go:21
MethodDraw
Draw draws the level's entities to the Screen s.
level.go:73
MethodDraw
Method for processing events, e.g. input
termloop.go:73
MethodDraw
Draw updates the framerate on the FpsText and draws it to the Screen s.
util.go:30
MethodDraw
Draw draws the entity to its current position on the screen. This is usually called every frame.
entity.go:38
MethodDraw
(s *tl.Screen)
_examples/pyramid.go:128
MethodDraw
(s *tl.Screen)
_examples/image.go:21
MethodDraw
(s *tl.Screen)
_examples/audio.go:40
MethodDraw
(screen *tl.Screen)
_examples/tutorial.go:12
MethodDrawBackground
DrawBackground draws the background Cell bg to each Cell of the Screen s.
level.go:64
MethodFill
Fill fills the canvas of the Entity with a Cell c.
entity.go:74
FunctionInitAudio
InitAudio starts up PortAudio, creates a stream and returns a pointer to an Audio struct, or an error.
extra/audio.go:34
FunctionLoadLevelFromMap
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
MethodLooping
Looping returns whether or not the Track is set to loop.
extra/audio.go:145
FunctionNewBaseLevel
NewBaseLevel creates a new BaseLevel with background bg. Returns a pointer to the new BaseLevel.
level.go:24
FunctionNewEntity
NewEntity creates a new Entity, with position (x, y) and size (width, height). Returns a pointer to the new Entity.
entity.go:15
FunctionNewFpsText
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