Documentation ¶
Overview ¶
libtcod-go is a go library providing bindings for libtcod
Most of the API is wrapped except: - custom containers - Go has it's own containers - threads, mutexes and semaphores - they are replaced by goroutines and channels - SDL renderer - currently Go has very cumbersome C callback mechanism
Index ¶
- Constants
- func Clamp(a, b, x int) int
- func ClampF(a, b, x float32) float32
- func ColorGenMap(cmap []Color, nbKey int, keyColor []Color, keyIndex []int)
- func If(condition bool, tv, fv interface{}) interface{}
- func Line(xo, yo, xd, yd int, userData interface{}, listener LineListener) bool
- func LineMt(xo, yo, xd, yd int, listener LineListener, userData interface{}, ...) bool
- func MouseIsCursorVisible() bool
- func MouseMove(x, y int)
- func MouseShowCursor(visible bool)
- func NamegenDestroy()
- func NamegenGenerate(name string) string
- func NamegenGenerateCustom(name, rule string) string
- func NamegenGetSets() []string
- func NamegenParse(filename string, random *Random)
- func RollDice(random *Random, s string) int
- func SysClipboardGet() string
- func SysClipboardSet(value string)
- func SysCreateDirectory(path string) bool
- func SysDeleteDirectory(path string) bool
- func SysDeleteFile(path string) bool
- func SysElapsedMilliseconds() uint32
- func SysElapsedSeconds() float32
- func SysFileExists(filename string) bool
- func SysForceFullscreenResolution(width, height int)
- func SysGetCharSize() (w, h int)
- func SysGetCurrentResolution() (w, h int)
- func SysGetDirectoryContent(path, pattern string) []string
- func SysGetFps() int
- func SysGetFullscreenOffsets() (offx, offy int)
- func SysGetLastFrameLength() float32
- func SysGetNumCores() int
- func SysIsDirectory(path string) bool
- func SysSaveScreenshot()
- func SysSaveScreenshotToFile(filename string)
- func SysSetFps(val int)
- func SysSleepMilliseconds(val uint32)
- func SysUpdateChar(asciiCode, fontx, fonty int, img Image, x, y int)
- type Alignment
- type BkgndFlag
- type BresenhamData
- type Bsp
- func (self *Bsp) AddSon(son *Bsp)
- func (self *Bsp) Contains(x, y int) bool
- func (self *Bsp) Father() *Bsp
- func (self *Bsp) FindNode(x, y int) *Bsp
- func (self *Bsp) IsLeaf() bool
- func (self *Bsp) Left() *Bsp
- func (self *Bsp) RemoveSons()
- func (self *Bsp) Resize(x, y, w, h int)
- func (self *Bsp) Right() *Bsp
- func (self *Bsp) SplitOnce(horizontal bool, position int)
- func (self *Bsp) SplitRecursive(randomizer *Random, nb int, minHSize int, minVSize int, maxHRatio float32, ...)
- func (self *Bsp) TraverseInOrder(listener BspListener, userData interface{}) bool
- func (self *Bsp) TraverseInvertedLevelOrder(listener BspListener, userData interface{}) bool
- func (self *Bsp) TraverseLevelOrder(listener BspListener, userData interface{}) bool
- func (self *Bsp) TraversePostOrder(listener BspListener, userData interface{}) bool
- func (self *Bsp) TraversePreOrder(listener BspListener, userData interface{}) bool
- type BspListener
- type Button
- type ColCtrl
- type Color
- func (self Color) Add(c2 Color) Color
- func (self Color) Darken(ratio float32) Color
- func (self Color) Equals(c2 Color) bool
- func (self Color) GetHSV() (h, s, v float32)
- func (self Color) GetHue() float32
- func (self Color) GetSaturation() float32
- func (self Color) GetValue() float32
- func (self Color) Lerp(c2 Color, coef float32) Color
- func (self Color) Lighten(ratio float32) Color
- func (self Color) Multiply(c2 Color) Color
- func (self Color) MultiplyScalar(value float32) Color
- func (self Color) ScaleHSV(scoef, vcoef float32) Color
- func (self Color) SetHSV(h float32, s float32, v float32) Color
- func (self Color) SetHue(h float32) Color
- func (self Color) SetSaturation(h float32) Color
- func (self Color) SetValue(h float32) Color
- func (self Color) ShiftHue(hshift float32) Color
- func (self Color) Subtract(c2 Color) Color
- type Console
- func (self *Console) Blit(xSrc, ySrc, wSrc, hSrc int, dst IConsole, xDst, yDst int, ...)
- func (self *Console) Clear()
- func (self *Console) GetAlignment() Alignment
- func (self *Console) GetBackgroundFlag() BkgndFlag
- func (self *Console) GetChar(x, y int) int
- func (self *Console) GetCharBackground(x, y int) Color
- func (self *Console) GetCharForeground(x, y int) Color
- func (self *Console) GetData() C.TCOD_console_t
- func (self *Console) GetDefaultBackground() Color
- func (self *Console) GetDefaultForeground() Color
- func (self *Console) GetHeight() int
- func (self *Console) GetWidth() int
- func (self *Console) HeightRect(x, y, w, h int, fmts string, v ...interface{}) int
- func (self *Console) Hline(x, y, l int, flag BkgndFlag)
- func (self *Console) Print(x, y int, fmts string, v ...interface{})
- func (self *Console) PrintEx(x, y int, flag BkgndFlag, alignment Alignment, fmts string, v ...interface{})
- func (self *Console) PrintFrame(x, y, w, h int, empty bool, flag BkgndFlag, fmts string, v ...interface{})
- func (self *Console) PrintRect(x, y, w, h int, fmts string, v ...interface{}) int
- func (self *Console) PrintRectEx(x, y, w, h int, flag BkgndFlag, alignment Alignment, fmts string, ...) int
- func (self *Console) PutChar(x, y, c int, flag BkgndFlag)
- func (self *Console) PutCharEx(x, y, c int, fore, back Color)
- func (self *Console) Rect(x, y, w, h int, clear bool, flag BkgndFlag)
- func (self *Console) RenderText(text *Text)
- func (self *Console) SetAlignment(alignment Alignment)
- func (self *Console) SetBackgroundFlag(flag BkgndFlag)
- func (self *Console) SetChar(x, y int, c int)
- func (self *Console) SetCharBackground(x, y int, color Color, flag BkgndFlag)
- func (self *Console) SetCharForeground(x, y int, color Color)
- func (self *Console) SetDefaultBackground(color Color)
- func (self *Console) SetDefaultForeground(color Color)
- func (self *Console) SetKeyColor(color Color)
- func (self *Console) Vline(x, y, l int, flag BkgndFlag)
- type Container
- type Dice
- type Dijkstra
- func (self *Dijkstra) Compute(rootX, rootY int)
- func (self *Dijkstra) Get(index int) (x, y int)
- func (self *Dijkstra) GetDistance(x, y int) float32
- func (self *Dijkstra) IsEmpty() bool
- func (self *Dijkstra) PathSet(x, y int) bool
- func (self *Dijkstra) PathWalk() (x, y int)
- func (self *Dijkstra) Size() int
- type Distribution
- type FloatArray
- type FovAlgorithm
- type Gui
- func (self *Gui) GetFocusedKeyboardWidget() IWidget
- func (self *Gui) GetFocusedWidget() IWidget
- func (self *Gui) IsFocused(w IWidget) bool
- func (self *Gui) IsKeyboardFocused(w IWidget) bool
- func (self *Gui) NewButton(label string, tip string, callback WidgetCallback, userData interface{}) *Button
- func (self *Gui) NewButtonDim(x, y, width, height int, label string, tip string, callback WidgetCallback, ...) *Button
- func (self *Gui) NewContainer(x, y, w, h int) *Container
- func (self *Gui) NewHBox(x, y, padding int) *HBox
- func (self *Gui) NewImageWidget(x, y, w, h int) *ImageWidget
- func (self *Gui) NewImageWidgetWithTip(x, y, w, h int, tip string) *ImageWidget
- func (self *Gui) NewLabel(x, y int, label string) *Label
- func (self *Gui) NewLabelWithTip(x, y int, label string, tip string) *Label
- func (self *Gui) NewRadioButton(label string, tip string, callback WidgetCallback, userData interface{}) *RadioButton
- func (self *Gui) NewRadioButtonWithTip(x, y, width, height int, label string, tip string, callback WidgetCallback, ...) *RadioButton
- func (self *Gui) NewSeparator(txt string) *Separator
- func (self *Gui) NewSeparatorWithTip(txt, tip string) *Separator
- func (self *Gui) NewSlider(x, y, w int, min, max float32, label string, tip string) *Slider
- func (self *Gui) NewStatusBar() *StatusBar
- func (self *Gui) NewStatusBarDim(x, y, w, h int) *StatusBar
- func (self *Gui) NewTextBox(x, y, w, maxw int, label, value string) *TextBox
- func (self *Gui) NewTextBoxWithTip(x, y, w, maxw int, label, value, tip string) *TextBox
- func (self *Gui) NewToggleButton(label, tip string, callback WidgetCallback, userData interface{}) *ToggleButton
- func (self *Gui) NewToggleButtonWithTip(x, y, width, height int, label, tip string, callback WidgetCallback, ...) *ToggleButton
- func (self *Gui) NewToolBar(x, y int, name, tip string) *ToolBar
- func (self *Gui) NewToolBarWithWidth(x, y, w int, name, tip string) *ToolBar
- func (self *Gui) NewVBox(x, y, padding int) *VBox
- func (self *Gui) NewWidget() *Widget
- func (self *Gui) NewWidgetAt(x, y int) *Widget
- func (self *Gui) NewWidgetDim(x, y, w, h int) *Widget
- func (self *Gui) Register(w IWidget)
- func (self *Gui) RenderWidgets()
- func (self *Gui) SetConsole(console IConsole)
- func (self *Gui) SetDefaultRadioGroup(group int)
- func (self *Gui) UnSelectRadioGroup(group int)
- func (self *Gui) Unregister(w IWidget)
- func (self *Gui) UpdateWidgets(k Key)
- type HBox
- type HeightMap
- func (self *HeightMap) Add(value float32)
- func (self *HeightMap) AddFbm(noise *Noise, mulx, muly, addx, addy, octaves, delta, scale float32)
- func (self *HeightMap) AddHill(hx, hy, hradius, hheight float32)
- func (self *HeightMap) AddHm(hm1 *HeightMap, hm2 *HeightMap)
- func (self *HeightMap) AddVoronoi(nbPoints, nbCoef int, coef []float32, rnd *Random)
- func (self *HeightMap) Clamp(min, max float32)
- func (self *HeightMap) Clear()
- func (self *HeightMap) Copy(source *HeightMap)
- func (self *HeightMap) CountCells(min, max float32) int
- func (self *HeightMap) DigBezier(px, py *[4]int, startRadius, startDepth, endRadius, endDepth float32)
- func (self *HeightMap) DigHill(hx, hy, hradius, hheight float32)
- func (self *HeightMap) GetHeight() int
- func (self *HeightMap) GetInterpolatedValue(x, y float32) float32
- func (self *HeightMap) GetMinMax() (min, max float32)
- func (self *HeightMap) GetNormal(x, y float32, n *[3]float32, waterLevel float32)
- func (self *HeightMap) GetNthValue(nth int) float32
- func (self *HeightMap) GetSlope(x, y int) float32
- func (self *HeightMap) GetValue(x, y int) float32
- func (self *HeightMap) GetWidth() int
- func (self *HeightMap) HasLandOnBorder(waterLevel float32) bool
- func (self *HeightMap) Islandify(seaLevel float32, random *Random)
- func (self *HeightMap) KernelTransform(kernelsize int, dx, dy []int, weight []float32, minLevel, maxLevel float32)
- func (self *HeightMap) Lerp(hm1 *HeightMap, hm2 *HeightMap, coef float32)
- func (self *HeightMap) Multiply(hm1 *HeightMap, hm2 *HeightMap)
- func (self *HeightMap) Normalize()
- func (self *HeightMap) NormalizeRange(min, max float32)
- func (self *HeightMap) RainErosion(nbDrops int, erosionCoef, sedimentationCoef float32, rnd *Random)
- func (self *HeightMap) Scale(value float32)
- func (self *HeightMap) ScaleFbm(noise *Noise, mulx, muly, addx, addy, octaves, delta, scale float32)
- func (self *HeightMap) SetNthValue(nth int, value float32)
- func (self *HeightMap) SetValue(x, y int, value float32)
- type IConsole
- type IWidget
- type Image
- func (self *Image) Blit(console *Console, x, y float32, bkgndFlag BkgndFlag, ...)
- func (self *Image) Blit2x(dest *Console, dx, dy, sx, sy, w, h int)
- func (self *Image) BlitRect(console *Console, x, y, w, h int, flag BkgndFlag)
- func (self *Image) Clear(color Color)
- func (self *Image) GetAlpha(x, y int) int
- func (self *Image) GetMipmapPixel(x0, y0, x1, y1 float32) Color
- func (self *Image) GetPixel(x, y int) Color
- func (self *Image) GetSize(w, h *int)
- func (self *Image) Hflip()
- func (self *Image) Invert()
- func (self *Image) IsPixelTransparent(x, y int) bool
- func (self *Image) PutPixel(x, y int, color Color)
- func (self *Image) RefreshConsole(console *Console)
- func (self *Image) Rotate90(numRotations int)
- func (self *Image) Save(filename string)
- func (self *Image) Scale(neww, newh int)
- func (self *Image) SetKeyColor(keyColor Color)
- func (self *Image) Vflip()
- type ImageWidget
- type Key
- type KeyCode
- type Label
- type LineListener
- type Map
- func (self *Map) Clear(isTransparent bool, isWalkable bool)
- func (self *Map) ComputeFov(playerX, playerY, maxRadius int, lightWalls bool, algo FovAlgorithm)
- func (self *Map) Copy(dest Map)
- func (self *Map) GetHeight() int
- func (self *Map) GetNbCells() int
- func (self *Map) GetWidth() int
- func (self *Map) IsInFov(x, y int) bool
- func (self *Map) IsTransparent(x, y int) bool
- func (self *Map) IsWalkable(x, y int) bool
- func (self *Map) SetInFov(x, y int, fov bool)
- func (self *Map) SetProperties(x, y int, isTransparent bool, isWalkable bool)
- type Mouse
- type Noise
- func (self *Noise) Get(f FloatArray) float32
- func (self *Noise) GetEx(f FloatArray, noiseType NoiseType) float32
- func (self *Noise) GetFbm(f FloatArray, octaves float32) float32
- func (self *Noise) GetFbmEx(f FloatArray, octaves float32, noiseType NoiseType) float32
- func (self *Noise) GetTurbulence(f FloatArray, octaves float32) float32
- func (self *Noise) GetTurbulenceEx(f FloatArray, octaves float32, noiseType NoiseType) float32
- func (self *Noise) SetType(noiseType NoiseType)
- type NoiseType
- type Parser
- type ParserProperty
- type ParserStruct
- func (self ParserStruct) AddFlag(propname string)
- func (self ParserStruct) AddListProperty(name string, valueType ParserValueType, mandatory bool)
- func (self ParserStruct) AddProperty(name string, valueType ParserValueType, mandatory bool)
- func (self ParserStruct) AddStructure(substruct ParserStruct)
- func (self ParserStruct) AddValueList(name string, valueList []string, mandatory bool)
- func (self ParserStruct) GetName() string
- func (self *ParserStruct) GetType(propname string) ParserValueType
- func (self *ParserStruct) IsMandatory(propname string) bool
- type ParserValueType
- type Path
- func (self *Path) Compute(ox, oy, dx, dy int) bool
- func (self *Path) Get(index int) (x, y int)
- func (self *Path) GetDestination() (x, y int)
- func (self *Path) GetOrigin() (x, y int)
- func (self *Path) IsEmpty() bool
- func (self *Path) Size() int
- func (self *Path) Walk(recalcWhenNeeded bool) (x, y int)
- type Point
- type RadioButton
- func (self *RadioButton) GetCurrentColors() (fore, back Color)
- func (self *RadioButton) GetSelectionColor() (fore, back Color)
- func (self *RadioButton) GetUseSelectionColor() bool
- func (self *RadioButton) IsSelected() bool
- func (self *RadioButton) Render(iself IWidget)
- func (self *RadioButton) Select()
- func (self *RadioButton) SetGroup(group int)
- func (self *RadioButton) SetSelectionColor(fore, back Color)
- func (self *RadioButton) SetUseSelectionColor(use bool)
- func (self *RadioButton) UnSelect()
- type RadioButtonStatic
- type Random
- func (self *Random) GetDouble(min, max float64) float64
- func (self *Random) GetDoubleMean(min, max, mean float64) float64
- func (self *Random) GetFloat(min, max float32) float32
- func (self *Random) GetFloatMean(min, max, mean float32) float32
- func (self *Random) GetInt(min, max int) int
- func (self *Random) GetIntMean(min, max, mean int) int
- func (self *Random) Restore(backup *Random)
- func (self *Random) Save() *Random
- func (self *Random) SetDistribution(distribution Distribution)
- type RandomAlgo
- type Renderer
- type RootConsole
- func (self *RootConsole) CheckForKeypress(flags int) Key
- func (self *RootConsole) Credits()
- func (self *RootConsole) DisableKeyboardRepeat()
- func (self *RootConsole) Flush()
- func (self *RootConsole) GetFade() uint8
- func (self *RootConsole) GetFadingColor() Color
- func (self *RootConsole) IsFullscreen() bool
- func (self *RootConsole) IsKeyPressed(keyCode KeyCode) bool
- func (self *RootConsole) IsWindowClosed() bool
- func (self *RootConsole) MapAsciiCodeToFont(asciiCode, fontCharX, fontCharY int)
- func (self *RootConsole) MapAsciiCodesToFont(asciiCode, fontCharX, fontCharY int)
- func (self *RootConsole) MapStringToFont(s string, fontCharX, fontCharY int)
- func (self *RootConsole) RenderCredits(x, y int, alpha bool) bool
- func (self *RootConsole) ResetCredits()
- func (self *RootConsole) SetColorControl(ctrl ColCtrl, fore, back Color)
- func (self *RootConsole) SetCustomFont(fontFile string, flags int, nbCharHoriz int, nbCharVertic int)
- func (self *RootConsole) SetDirty(x, y, w, h int)
- func (self *RootConsole) SetFade(val uint8, fade Color)
- func (self *RootConsole) SetFullscreen(fullscreen bool)
- func (self *RootConsole) SetKeyboardRepeat(initialDelay, interval int)
- func (self *RootConsole) SetWindowTitle(title string)
- func (self *RootConsole) WaitForKeypress(flush bool) Key
- type Separator
- type Slider
- func (self *Slider) GetCurrentColors() (fore, back Color)
- func (self *Slider) Render(iself IWidget)
- func (self *Slider) SetCallback(callback SliderCallback, data interface{})
- func (self *Slider) SetFormat(fmt string)
- func (self *Slider) SetMinMax(min, max float32)
- func (self *Slider) SetSensitivity(sensitivity float32)
- func (self *Slider) SetValue(value float32)
- func (self *Slider) Update(iself IWidget, k Key)
- type SliderCallback
- type StatusBar
- type Text
- func (self *Text) Get() string
- func (self *Text) Render(console IConsole)
- func (self *Text) Reset()
- func (self *Text) SetColors(fore, back Color, backTransparency float32)
- func (self *Text) SetProperties(cursorChar int, blinkInterval int, prompt string, tabSize int)
- func (self *Text) Update(key Key)
- type TextBox
- func (self *TextBox) GetBlinkingDelay() float32
- func (self *TextBox) GetText() string
- func (self *TextBox) Render(iself IWidget)
- func (self *TextBox) SetBlinkingDelay(delay float32)
- func (self *TextBox) SetCallback(callback TextBoxCallback, data interface{})
- func (self *TextBox) SetText(txt string)
- func (self *TextBox) Update(iself IWidget, k Key)
- type TextBoxCallback
- type TextBoxStatic
- type ToggleButton
- type ToolBar
- func (self *ToolBar) AddSeparator(txt string)
- func (self *ToolBar) AddSeparatorWithTip(txt string, tip string)
- func (self *ToolBar) ComputeSize()
- func (self *ToolBar) GetShouldPrintFrame() bool
- func (self *ToolBar) Render(iself IWidget)
- func (self *ToolBar) SetName(name string)
- func (self *ToolBar) SetShouldPrintFrame(value bool)
- type VBox
- type Widget
- func (self *Widget) ComputeSize()
- func (self *Widget) Delete()
- func (self *Widget) GetCurrentColors() (fore, back Color)
- func (self *Widget) GetDefaultBackground() (col, colFocus Color)
- func (self *Widget) GetDefaultForeground() (col, colFocus Color)
- func (self *Widget) GetGui() *Gui
- func (self *Widget) GetHeight() int
- func (self *Widget) GetMouseIn() bool
- func (self *Widget) GetMouseL() bool
- func (self *Widget) GetTip() string
- func (self *Widget) GetUserData() interface{}
- func (self *Widget) GetVisible() bool
- func (self *Widget) GetWidth() int
- func (self *Widget) GetX() int
- func (self *Widget) GetY() int
- func (self *Widget) IsVisible() bool
- func (self *Widget) Move(x, y int)
- func (self *Widget) Render(iself IWidget)
- func (self *Widget) SetDefaultBackground(col, colFocus Color)
- func (self *Widget) SetDefaultForeground(col, colFocus Color)
- func (self *Widget) SetGui(gui *Gui)
- func (self *Widget) SetHeight(h int)
- func (self *Widget) SetMouseIn(mouseIn bool)
- func (self *Widget) SetMouseL(mouseL bool)
- func (self *Widget) SetTip(tip string)
- func (self *Widget) SetUserData(data interface{})
- func (self *Widget) SetVisible(visible bool)
- func (self *Widget) SetWidth(w int)
- func (self *Widget) SetX(x int)
- func (self *Widget) SetY(y int)
- func (self *Widget) Update(iself IWidget, k Key)
- type WidgetCallback
- type Zip
- func (self *Zip) GetChar() byte
- func (self *Zip) GetColor() Color
- func (self *Zip) GetConsole() *Console
- func (self *Zip) GetCurrentBytes() uint32
- func (self *Zip) GetData(nbBytes int, data unsafe.Pointer) int
- func (self *Zip) GetFloat() float32
- func (self *Zip) GetImage() *Image
- func (self *Zip) GetInt() int
- func (self *Zip) GetRemainingBytes() uint32
- func (self *Zip) GetString() string
- func (self *Zip) LoadFromFile(filename string)
- func (self *Zip) PutChar(val byte)
- func (self *Zip) PutColor(val Color)
- func (self *Zip) PutConsole(val *Console)
- func (self *Zip) PutData(nbBytes int, data unsafe.Pointer)
- func (self *Zip) PutFloat(val float32)
- func (self *Zip) PutImage(val *Image)
- func (self *Zip) PutInt(val int)
- func (self *Zip) PutString(val string)
- func (self *Zip) SaveToFile(filename string)
- func (self *Zip) SkipBytes(nbBytes uint32)
Constants ¶
const ( BKGND_ADD = C.TCOD_BKGND_ADD BKGND_ADDA = C.TCOD_BKGND_ADDA BKGND_ALPH = C.TCOD_BKGND_ALPH BKGND_BURN = C.TCOD_BKGND_BURN BKGND_COLOR_BURN = C.TCOD_BKGND_COLOR_BURN BKGND_COLOR_DODGE = C.TCOD_BKGND_COLOR_DODGE BKGND_DARKEN = C.TCOD_BKGND_DARKEN BKGND_LIGHTEN = C.TCOD_BKGND_LIGHTEN BKGND_MULTIPLY = C.TCOD_BKGND_MULTIPLY BKGND_NONE = C.TCOD_BKGND_NONE BKGND_OVERLAY = C.TCOD_BKGND_OVERLAY BKGND_SCREEN = C.TCOD_BKGND_SCREEN BKGND_SET = C.TCOD_BKGND_SET )
console enums
const ( CHAR_ARROW2_E = C.TCOD_CHAR_ARROW2_E CHAR_ARROW2_N = C.TCOD_CHAR_ARROW2_N CHAR_ARROW2_S = C.TCOD_CHAR_ARROW2_S CHAR_ARROW2_W = C.TCOD_CHAR_ARROW2_W CHAR_ARROW_E = C.TCOD_CHAR_ARROW_E CHAR_ARROW_N = C.TCOD_CHAR_ARROW_N CHAR_ARROW_S = C.TCOD_CHAR_ARROW_S CHAR_ARROW_W = C.TCOD_CHAR_ARROW_W CHAR_BLOCK1 = C.TCOD_CHAR_BLOCK1 CHAR_BLOCK2 = C.TCOD_CHAR_BLOCK2 CHAR_BLOCK3 = C.TCOD_CHAR_BLOCK3 CHAR_CHECKBOX_SET = C.TCOD_CHAR_CHECKBOX_SET CHAR_CHECKBOX_UNSET = C.TCOD_CHAR_CHECKBOX_UNSET CHAR_CROSS = C.TCOD_CHAR_CROSS CHAR_DARROW_H = C.TCOD_CHAR_DARROW_H CHAR_DARROW_V = C.TCOD_CHAR_DARROW_V CHAR_DCROSS = C.TCOD_CHAR_DCROSS CHAR_DHLINE = C.TCOD_CHAR_DHLINE CHAR_DNE = C.TCOD_CHAR_DNE CHAR_DNW = C.TCOD_CHAR_DNW CHAR_DSE = C.TCOD_CHAR_DSE CHAR_DSW = C.TCOD_CHAR_DSW CHAR_DTEEE = C.TCOD_CHAR_DTEEE CHAR_DTEEN = C.TCOD_CHAR_DTEEN CHAR_DTEES = C.TCOD_CHAR_DTEES CHAR_DTEEW = C.TCOD_CHAR_DTEEW CHAR_DVLINE = C.TCOD_CHAR_DVLINE CHAR_HLINE = C.TCOD_CHAR_HLINE CHAR_NE = C.TCOD_CHAR_NE CHAR_NW = C.TCOD_CHAR_NW CHAR_RADIO_SET = C.TCOD_CHAR_RADIO_SET CHAR_RADIO_UNSET = C.TCOD_CHAR_RADIO_UNSET CHAR_SE = C.TCOD_CHAR_SE CHAR_SUBP_DIAG = C.TCOD_CHAR_SUBP_DIAG CHAR_SUBP_E = C.TCOD_CHAR_SUBP_E CHAR_SUBP_N = C.TCOD_CHAR_SUBP_N CHAR_SUBP_NE = C.TCOD_CHAR_SUBP_NE CHAR_SUBP_NW = C.TCOD_CHAR_SUBP_NW CHAR_SUBP_SE = C.TCOD_CHAR_SUBP_SE CHAR_SUBP_SW = C.TCOD_CHAR_SUBP_SW CHAR_SW = C.TCOD_CHAR_SW CHAR_TEEE = C.TCOD_CHAR_TEEE CHAR_TEEN = C.TCOD_CHAR_TEEN CHAR_TEES = C.TCOD_CHAR_TEES CHAR_TEEW = C.TCOD_CHAR_TEEW CHAR_VLINE = C.TCOD_CHAR_VLINE )
const ( COLCTRL_1 = C.TCOD_COLCTRL_1 COLCTRL_2 = C.TCOD_COLCTRL_2 COLCTRL_3 = C.TCOD_COLCTRL_3 COLCTRL_4 = C.TCOD_COLCTRL_4 COLCTRL_5 = C.TCOD_COLCTRL_5 COLCTRL_BACK_RGB = C.TCOD_COLCTRL_BACK_RGB COLCTRL_FORE_RGB = C.TCOD_COLCTRL_FORE_RGB COLCTRL_NUMBER = C.TCOD_COLCTRL_NUMBER COLCTRL_STOP = C.TCOD_COLCTRL_STOP )
const ( FONT_LAYOUT_ASCII_INCOL = C.TCOD_FONT_LAYOUT_ASCII_INCOL FONT_LAYOUT_ASCII_INROW = C.TCOD_FONT_LAYOUT_ASCII_INROW FONT_LAYOUT_TCOD = C.TCOD_FONT_LAYOUT_TCOD FONT_TYPE_GREYSCALE = C.TCOD_FONT_TYPE_GREYSCALE )
const ( K_0 = C.TCODK_0 K_1 = C.TCODK_1 K_2 = C.TCODK_2 K_3 = C.TCODK_3 K_4 = C.TCODK_4 K_5 = C.TCODK_5 K_6 = C.TCODK_6 K_7 = C.TCODK_7 K_8 = C.TCODK_8 K_9 = C.TCODK_9 K_ALT = C.TCODK_ALT K_APPS = C.TCODK_APPS K_BACKSPACE = C.TCODK_BACKSPACE K_CAPSLOCK = C.TCODK_CAPSLOCK K_CHAR = C.TCODK_CHAR K_CONTROL = C.TCODK_CONTROL K_DELETE = C.TCODK_DELETE K_DOWN = C.TCODK_DOWN K_END = C.TCODK_END K_ENTER = C.TCODK_ENTER K_ESCAPE = C.TCODK_ESCAPE KEY_PRESSED = C.TCOD_KEY_PRESSED KEY_RELEASED = C.TCOD_KEY_RELEASED K_F1 = C.TCODK_F1 K_F10 = C.TCODK_F10 K_F11 = C.TCODK_F11 K_F12 = C.TCODK_F12 K_F2 = C.TCODK_F2 K_F3 = C.TCODK_F3 K_F4 = C.TCODK_F4 K_F5 = C.TCODK_F5 K_F6 = C.TCODK_F6 K_F7 = C.TCODK_F7 K_F8 = C.TCODK_F8 K_F9 = C.TCODK_F9 K_HOME = C.TCODK_HOME K_INSERT = C.TCODK_INSERT K_KP0 = C.TCODK_KP0 K_KP1 = C.TCODK_KP1 K_KP2 = C.TCODK_KP2 K_KP3 = C.TCODK_KP3 K_KP4 = C.TCODK_KP4 K_KP5 = C.TCODK_KP5 K_KP6 = C.TCODK_KP6 K_KP7 = C.TCODK_KP7 K_KP8 = C.TCODK_KP8 K_KP9 = C.TCODK_KP9 K_KPADD = C.TCODK_KPADD K_KPDEC = C.TCODK_KPDEC K_KPDIV = C.TCODK_KPDIV K_KPENTER = C.TCODK_KPENTER K_KPMUL = C.TCODK_KPMUL K_KPSUB = C.TCODK_KPSUB K_LEFT = C.TCODK_LEFT K_LWIN = C.TCODK_LWIN K_NONE = C.TCODK_NONE K_NUMLOCK = C.TCODK_NUMLOCK K_PAGEDOWN = C.TCODK_PAGEDOWN K_PAGEUP = C.TCODK_PAGEUP K_PAUSE = C.TCODK_PAUSE K_PRINTSCREEN = C.TCODK_PRINTSCREEN K_RIGHT = C.TCODK_RIGHT K_RWIN = C.TCODK_RWIN K_SCROLLLOCK = C.TCODK_SCROLLLOCK K_SHIFT = C.TCODK_SHIFT K_SPACE = C.TCODK_SPACE K_TAB = C.TCODK_TAB K_UP = C.TCODK_UP )
const ( FOV_BASIC = C.FOV_BASIC FOV_DIAMOND = C.FOV_DIAMOND FOV_SHADOW = C.FOV_SHADOW FOV_PERMISSIVE_0 = C.FOV_PERMISSIVE_0 FOV_PERMISSIVE_1 = C.FOV_PERMISSIVE_1 FOV_PERMISSIVE_2 = C.FOV_PERMISSIVE_2 FOV_PERMISSIVE_3 = C.FOV_PERMISSIVE_3 FOV_PERMISSIVE_4 = C.FOV_PERMISSIVE_4 FOV_PERMISSIVE_5 = C.FOV_PERMISSIVE_5 FOV_PERMISSIVE_6 = C.FOV_PERMISSIVE_6 FOV_PERMISSIVE_7 = C.FOV_PERMISSIVE_7 FOV_PERMISSIVE_8 = C.FOV_PERMISSIVE_8 FOV_RESTRICTIVE = C.FOV_RESTRICTIVE NB_FOV_ALGORITHMS = C.NB_FOV_ALGORITHMS )
const ( RNG_MT = C.TCOD_RNG_MT RNG_CMWC = C.TCOD_RNG_CMWC )
const ( TYPE_NONE = C.TCOD_TYPE_NONE TYPE_BOOL = C.TCOD_TYPE_BOOL TYPE_CHAR = C.TCOD_TYPE_CHAR TYPE_INT = C.TCOD_TYPE_INT TYPE_FLOAT = C.TCOD_TYPE_FLOAT TYPE_STRING = C.TCOD_TYPE_STRING TYPE_COLOR = C.TCOD_TYPE_COLOR TYPE_DICE = C.TCOD_TYPE_DICE TYPE_VALUELIST00 = C.TCOD_TYPE_VALUELIST00 TYPE_VALUELIST01 = C.TCOD_TYPE_VALUELIST01 TYPE_VALUELIST02 = C.TCOD_TYPE_VALUELIST02 TYPE_VALUELIST03 = C.TCOD_TYPE_VALUELIST03 TYPE_VALUELIST04 = C.TCOD_TYPE_VALUELIST04 TYPE_VALUELIST05 = C.TCOD_TYPE_VALUELIST05 TYPE_VALUELIST06 = C.TCOD_TYPE_VALUELIST06 TYPE_VALUELIST07 = C.TCOD_TYPE_VALUELIST07 TYPE_VALUELIST08 = C.TCOD_TYPE_VALUELIST08 TYPE_VALUELIST09 = C.TCOD_TYPE_VALUELIST09 TYPE_VALUELIST10 = C.TCOD_TYPE_VALUELIST10 TYPE_VALUELIST11 = C.TCOD_TYPE_VALUELIST11 TYPE_VALUELIST12 = C.TCOD_TYPE_VALUELIST12 TYPE_VALUELIST13 = C.TCOD_TYPE_VALUELIST13 TYPE_VALUELIST14 = C.TCOD_TYPE_VALUELIST14 TYPE_VALUELIST15 = C.TCOD_TYPE_VALUELIST15 TYPE_CUSTOM00 = C.TCOD_TYPE_CUSTOM00 TYPE_CUSTOM01 = C.TCOD_TYPE_CUSTOM01 TYPE_CUSTOM02 = C.TCOD_TYPE_CUSTOM02 TYPE_CUSTOM03 = C.TCOD_TYPE_CUSTOM03 TYPE_CUSTOM04 = C.TCOD_TYPE_CUSTOM04 TYPE_CUSTOM05 = C.TCOD_TYPE_CUSTOM05 TYPE_CUSTOM06 = C.TCOD_TYPE_CUSTOM06 TYPE_CUSTOM07 = C.TCOD_TYPE_CUSTOM07 TYPE_CUSTOM08 = C.TCOD_TYPE_CUSTOM08 TYPE_CUSTOM09 = C.TCOD_TYPE_CUSTOM09 TYPE_CUSTOM10 = C.TCOD_TYPE_CUSTOM10 TYPE_CUSTOM11 = C.TCOD_TYPE_CUSTOM11 TYPE_CUSTOM12 = C.TCOD_TYPE_CUSTOM12 TYPE_CUSTOM13 = C.TCOD_TYPE_CUSTOM13 TYPE_CUSTOM14 = C.TCOD_TYPE_CUSTOM14 TYPE_CUSTOM15 = C.TCOD_TYPE_CUSTOM15 TYPE_LIST = C.TCOD_TYPE_LIST )
const ( NOISE_PERLIN = C.TCOD_NOISE_PERLIN NOISE_SIMPLEX = C.TCOD_NOISE_SIMPLEX NOISE_WAVELET = C.TCOD_NOISE_WAVELET NOISE_DEFAULT = C.TCOD_NOISE_DEFAULT )
const ( RENDERER_GLSL = C.TCOD_RENDERER_GLSL RENDERER_OPENGL = C.TCOD_RENDERER_OPENGL RENDERER_SDL = C.TCOD_RENDERER_SDL NB_RENDERERS = C.TCOD_NB_RENDERERS )
renderer enum
const ( LEFT = C.TCOD_LEFT RIGHT = C.TCOD_RIGHT CENTER = C.TCOD_CENTER )
alignment enum
const ( DISTRIBUTION_LINEAR = C.TCOD_DISTRIBUTION_LINEAR DISTRIBUTION_GAUSSIAN = C.TCOD_DISTRIBUTION_GAUSSIAN DISTRIBUTION_GAUSSIAN_RANGE = C.TCOD_DISTRIBUTION_GAUSSIAN_RANGE DISTRIBUTION_GAUSSIAN_INVERSE = C.TCOD_DISTRIBUTION_GAUSSIAN_INVERSE DISTRIBUTION_GAUSSIAN_RANGE_INVERSE = C.TCOD_DISTRIBUTION_GAUSSIAN_RANGE_INVERSE )
distribution for mersenne
const NOISE_DEFAULT_HURST = 0.5
const NOISE_DEFAULT_LACUNARITY = 2.0
const NOISE_MAX_DIMENSIONS = 4
const NOISE_MAX_OCTAVES = 128
Variables ¶
This section is empty.
Functions ¶
func Line ¶
func Line(xo, yo, xd, yd int, userData interface{}, listener LineListener) bool
func LineMt ¶
func LineMt(xo, yo, xd, yd int, listener LineListener, userData interface{}, data *BresenhamData) bool
func MouseIsCursorVisible ¶
func MouseIsCursorVisible() bool
func MouseShowCursor ¶
func MouseShowCursor(visible bool)
func NamegenGenerateCustom ¶
generate a name using a custom generation rule
func NamegenGetSets ¶
func NamegenGetSets() []string
retrieve the list of all available syllable set names
func NamegenParse ¶
func SysClipboardGet ¶
func SysClipboardGet() string
func SysClipboardSet ¶
func SysClipboardSet(value string)
func SysDeleteDirectory ¶
func SysDeleteFile ¶
func SysElapsedMilliseconds ¶
func SysElapsedMilliseconds() uint32
func SysElapsedSeconds ¶
func SysElapsedSeconds() float32
func SysFileExists ¶
func SysForceFullscreenResolution ¶
func SysForceFullscreenResolution(width, height int)
func SysGetCharSize ¶
func SysGetCharSize() (w, h int)
func SysGetCurrentResolution ¶
func SysGetCurrentResolution() (w, h int)
func SysGetDirectoryContent ¶
func SysGetFullscreenOffsets ¶
func SysGetFullscreenOffsets() (offx, offy int)
func SysGetLastFrameLength ¶
func SysGetLastFrameLength() float32
func SysGetNumCores ¶
func SysGetNumCores() int
func SysIsDirectory ¶
func SysSaveScreenshot ¶
func SysSaveScreenshot()
func SysSaveScreenshotToFile ¶
func SysSaveScreenshotToFile(filename string)
func SysSleepMilliseconds ¶
func SysSleepMilliseconds(val uint32)
func SysUpdateChar ¶
Types ¶
type BresenhamData ¶
type BresenhamData struct {
// contains filtered or unexported fields
}
thread-safe versions
type Bsp ¶
type Bsp struct {
X, Y, W, H int // node position & size
Position int // position of splitting
Level uint8 // level in the tree
Horizontal bool // horizontal splitting ?
// contains filtered or unexported fields
}
BSP Dungeon generation
func NewBspIntern ¶
func NewBspWithSize ¶
func (*Bsp) RemoveSons ¶
func (self *Bsp) RemoveSons()
func (*Bsp) SplitRecursive ¶
func (*Bsp) TraverseInOrder ¶
func (self *Bsp) TraverseInOrder(listener BspListener, userData interface{}) bool
func (*Bsp) TraverseInvertedLevelOrder ¶
func (self *Bsp) TraverseInvertedLevelOrder(listener BspListener, userData interface{}) bool
TODO can it store Go values in list structure?? maybe replace it with record
func (*Bsp) TraverseLevelOrder ¶
func (self *Bsp) TraverseLevelOrder(listener BspListener, userData interface{}) bool
func (*Bsp) TraversePostOrder ¶
func (self *Bsp) TraversePostOrder(listener BspListener, userData interface{}) bool
func (*Bsp) TraversePreOrder ¶
func (self *Bsp) TraversePreOrder(listener BspListener, userData interface{}) bool
type BspListener ¶
type Button ¶
type Button struct { Widget // contains filtered or unexported fields }
func (*Button) ComputeSize ¶
func (self *Button) ComputeSize()
type ColCtrl ¶
type ColCtrl C.TCOD_colctrl_t
type Color ¶
func NewColorHSV ¶
func NewColorRGB ¶
func (Color) GetSaturation ¶
func (Color) MultiplyScalar ¶
func (Color) SetSaturation ¶
type Console ¶
type Console struct {
Data C.TCOD_console_t
}
func NewConsole ¶
func (*Console) GetAlignment ¶
func (*Console) GetBackgroundFlag ¶
func (*Console) GetCharBackground ¶
func (*Console) GetCharForeground ¶
func (*Console) GetData ¶
func (self *Console) GetData() C.TCOD_console_t
func (*Console) GetDefaultBackground ¶
func (*Console) GetDefaultForeground ¶
func (*Console) HeightRect ¶
func (*Console) PrintFrame ¶
func (*Console) PrintRectEx ¶
func (*Console) RenderText ¶
func (*Console) SetAlignment ¶
func (*Console) SetBackgroundFlag ¶
func (*Console) SetCharBackground ¶
func (*Console) SetCharForeground ¶
func (*Console) SetDefaultBackground ¶
func (*Console) SetDefaultForeground ¶
func (*Console) SetKeyColor ¶
type Container ¶
type Container struct { Widget // contains filtered or unexported fields }
func (*Container) RemoveWidget ¶
type Dice ¶
type Dice struct {
Data C.TCOD_dice_t
}
type Dijkstra ¶
type Dijkstra struct {
Data C.TCOD_dijkstra_t
}
func NewDijkstraUsingMap ¶
func (*Dijkstra) GetDistance ¶
type Distribution ¶
type Distribution C.TCOD_distribution_t
type FloatArray ¶
type FloatArray []float32
type FovAlgorithm ¶
type FovAlgorithm C.TCOD_fov_algorithm_t
type Gui ¶
type Gui struct {
// contains filtered or unexported fields
}
func (*Gui) GetFocusedKeyboardWidget ¶
func (*Gui) GetFocusedWidget ¶
func (*Gui) IsKeyboardFocused ¶
func (*Gui) NewButton ¶
func (self *Gui) NewButton(label string, tip string, callback WidgetCallback, userData interface{}) *Button
func (*Gui) NewButtonDim ¶
func (*Gui) NewContainer ¶
func (*Gui) NewImageWidget ¶
func (self *Gui) NewImageWidget(x, y, w, h int) *ImageWidget
func (*Gui) NewImageWidgetWithTip ¶
func (self *Gui) NewImageWidgetWithTip(x, y, w, h int, tip string) *ImageWidget
func (*Gui) NewLabelWithTip ¶
func (*Gui) NewRadioButton ¶
func (self *Gui) NewRadioButton(label string, tip string, callback WidgetCallback, userData interface{}) *RadioButton
func (*Gui) NewRadioButtonWithTip ¶
func (self *Gui) NewRadioButtonWithTip(x, y, width, height int, label string, tip string, callback WidgetCallback, userData interface{}) *RadioButton
func (*Gui) NewSeparator ¶
func (*Gui) NewSeparatorWithTip ¶
func (*Gui) NewStatusBar ¶
func (*Gui) NewStatusBarDim ¶
func (*Gui) NewTextBox ¶
func (*Gui) NewTextBoxWithTip ¶
func (*Gui) NewToggleButton ¶
func (self *Gui) NewToggleButton(label, tip string, callback WidgetCallback, userData interface{}) *ToggleButton
func (*Gui) NewToggleButtonWithTip ¶
func (self *Gui) NewToggleButtonWithTip(x, y, width, height int, label, tip string, callback WidgetCallback, userData interface{}) *ToggleButton
func (*Gui) NewToolBarWithWidth ¶
func (*Gui) NewWidgetAt ¶
func (*Gui) NewWidgetDim ¶
func (*Gui) RenderWidgets ¶
func (self *Gui) RenderWidgets()
func (*Gui) SetConsole ¶
func (*Gui) SetDefaultRadioGroup ¶
func (*Gui) UnSelectRadioGroup ¶
func (*Gui) Unregister ¶
func (*Gui) UpdateWidgets ¶
type HeightMap ¶
type HeightMap struct {
Data *C.TCOD_heightmap_t
}
func NewHeightMap ¶
func (*HeightMap) AddVoronoi ¶
func (*HeightMap) CountCells ¶
func (*HeightMap) GetInterpolatedValue ¶
func (*HeightMap) GetNthValue ¶
func (*HeightMap) HasLandOnBorder ¶
func (*HeightMap) KernelTransform ¶
func (*HeightMap) NormalizeRange ¶
func (*HeightMap) RainErosion ¶
func (*HeightMap) SetNthValue ¶
type IConsole ¶
type IConsole interface { GetData() C.TCOD_console_t GetDefaultBackground() Color GetDefaultForeground() Color SetDefaultForeground(color Color) SetDefaultBackground(color Color) Clear() GetCharBackground(x, y int) Color GetCharForeground(x, y int) Color SetCharBackground(x, y int, color Color, flag BkgndFlag) SetCharForeground(x, y int, color Color) SetChar(x, y int, c int) PutChar(x, y, c int, flag BkgndFlag) PutCharEx(x, y, c int, fore, back Color) Print(x, y int, fmts string, v ...interface{}) PrintEx(x, y int, flag BkgndFlag, alignment Alignment, fmts string, v ...interface{}) PrintRect(x, y, w, h int, fmts string, v ...interface{}) int PrintRectEx(x, y, w, h int, flag BkgndFlag, alignment Alignment, fmts string, v ...interface{}) int HeightRect(x, y, w, h int, fmts string, v ...interface{}) int SetBackgroundFlag(flag BkgndFlag) GetBackgroundFlag() BkgndFlag SetAlignment(alignment Alignment) GetAlignment() Alignment Rect(x, y, w, h int, clear bool, flag BkgndFlag) Hline(x, y, l int, flag BkgndFlag) Vline(x, y, l int, flag BkgndFlag) PrintFrame(x, y, w, h int, empty bool, flag BkgndFlag, fmts string, v ...interface{}) GetChar(x, y int) int GetWidth() int GetHeight() int SetKeyColor(color Color) Blit(xSrc, ySrc, wSrc, hSrc int, dst IConsole, xDst, yDst int, foregroundAlpha, backgroundAlpha float32) }
type IWidget ¶
type IWidget interface { IsVisible() bool ComputeSize() Update(w IWidget, k Key) Render(w IWidget) GetX() int SetX(x int) GetY() int SetY(y int) GetWidth() int SetWidth(w int) GetHeight() int SetHeight(h int) GetUserData() interface{} SetUserData(data interface{}) GetTip() string SetTip(tip string) GetMouseIn() bool SetMouseIn(mouseIn bool) GetMouseL() bool SetMouseL(mouseL bool) GetVisible() bool SetVisible(visible bool) SetGui(*Gui) GetGui() *Gui SetDefaultBackground(col, colFocus Color) SetDefaultForeground(col, colFocus Color) GetDefaultBackground() (col, colFocus Color) GetDefaultForeground() (col, colFocus Color) GetCurrentColors() (fore, back Color) // contains filtered or unexported methods }
type Image ¶
type Image struct {
Data C.TCOD_image_t
}
func NewImageFromConsole ¶
func (*Image) GetMipmapPixel ¶
func (*Image) IsPixelTransparent ¶
func (*Image) RefreshConsole ¶
func (*Image) SetKeyColor ¶
type ImageWidget ¶
type ImageWidget struct { Widget // contains filtered or unexported fields }
Image
func (*ImageWidget) Render ¶
func (self *ImageWidget) Render(iself IWidget)
type Label ¶
type Label struct { Widget // contains filtered or unexported fields }
func (*Label) ComputeSize ¶
func (self *Label) ComputeSize()
type LineListener ¶
type Map ¶
type Map struct {
Data C.TCOD_map_t
}
func (*Map) ComputeFov ¶
func (self *Map) ComputeFov(playerX, playerY, maxRadius int, lightWalls bool, algo FovAlgorithm)
calculate the field of view (potentially visible cells from player_x,player_y)
func (*Map) GetNbCells ¶
func (*Map) IsTransparent ¶
func (*Map) IsWalkable ¶
type Mouse ¶
type Mouse struct {
X, Y int
Dx, Dy int
Cx, Cy int
Dcx, Dcy int
LButton bool
RButton bool
MButton bool
LButtonPressed bool
RButtonPressed bool
MButtonPressed bool
WheelUp bool
WheelDown bool
}
Mouse
func MouseGetStatus ¶
func MouseGetStatus() Mouse
type Noise ¶
type Noise struct {
Data C.TCOD_noise_t
}
func NewNoiseWithOptions ¶
func (*Noise) Get ¶
func (self *Noise) Get(f FloatArray) float32
func (*Noise) GetFbmEx ¶
func (self *Noise) GetFbmEx(f FloatArray, octaves float32, noiseType NoiseType) float32
func (*Noise) GetTurbulence ¶
func (self *Noise) GetTurbulence(f FloatArray, octaves float32) float32
func (*Noise) GetTurbulenceEx ¶
func (self *Noise) GetTurbulenceEx(f FloatArray, octaves float32, noiseType NoiseType) float32
type NoiseType ¶
type NoiseType C.TCOD_noise_type_t
type Parser ¶
type Parser struct {
Data C.TCOD_parser_t
}
func (*Parser) RegisterStruct ¶
func (self *Parser) RegisterStruct(name string) ParserStruct
func (*Parser) Run ¶
func (self *Parser) Run(filename string) []ParserProperty
TODO listeners are not supported Running parser return list of parsed properties
type ParserProperty ¶
type ParserProperty struct { Name string ValueType ParserValueType Value interface{} }
type ParserStruct ¶
type ParserStruct struct {
Data C.TCOD_parser_struct_t
}
func (ParserStruct) AddFlag ¶
func (self ParserStruct) AddFlag(propname string)
func (ParserStruct) AddListProperty ¶
func (self ParserStruct) AddListProperty(name string, valueType ParserValueType, mandatory bool)
func (ParserStruct) AddProperty ¶
func (self ParserStruct) AddProperty(name string, valueType ParserValueType, mandatory bool)
func (ParserStruct) AddStructure ¶
func (self ParserStruct) AddStructure(substruct ParserStruct)
func (ParserStruct) AddValueList ¶
func (self ParserStruct) AddValueList(name string, valueList []string, mandatory bool)
func (ParserStruct) GetName ¶
func (self ParserStruct) GetName() string
func (*ParserStruct) GetType ¶
func (self *ParserStruct) GetType(propname string) ParserValueType
func (*ParserStruct) IsMandatory ¶
func (self *ParserStruct) IsMandatory(propname string) bool
type ParserValueType ¶
type ParserValueType C.TCOD_value_type_t
type Path ¶
type Path struct {
Data C.TCOD_path_t
}
Path
func NewPathUsingMap ¶
func (*Path) GetDestination ¶
type Point ¶
type Point struct {
// contains filtered or unexported fields
}
func LinePoints ¶
returns slice of Points where the line was drawn
type RadioButton ¶
type RadioButton struct { Button // contains filtered or unexported fields }
func (*RadioButton) GetCurrentColors ¶
func (self *RadioButton) GetCurrentColors() (fore, back Color)
func (*RadioButton) GetSelectionColor ¶
func (self *RadioButton) GetSelectionColor() (fore, back Color)
func (*RadioButton) GetUseSelectionColor ¶
func (self *RadioButton) GetUseSelectionColor() bool
func (*RadioButton) IsSelected ¶
func (self *RadioButton) IsSelected() bool
func (*RadioButton) Render ¶
func (self *RadioButton) Render(iself IWidget)
func (*RadioButton) Select ¶
func (self *RadioButton) Select()
func (*RadioButton) SetGroup ¶
func (self *RadioButton) SetGroup(group int)
func (*RadioButton) SetSelectionColor ¶
func (self *RadioButton) SetSelectionColor(fore, back Color)
func (*RadioButton) SetUseSelectionColor ¶
func (self *RadioButton) SetUseSelectionColor(use bool)
func (*RadioButton) UnSelect ¶
func (self *RadioButton) UnSelect()
type RadioButtonStatic ¶
type RadioButtonStatic struct {
// contains filtered or unexported fields
}
func NewRadioButtonStatic ¶
func NewRadioButtonStatic() *RadioButtonStatic
func (*RadioButtonStatic) SetDefaultGroup ¶
func (self *RadioButtonStatic) SetDefaultGroup(group int)
func (*RadioButtonStatic) UnSelectGroup ¶
func (self *RadioButtonStatic) UnSelectGroup(group int)
type Random ¶
type Random struct {
Data C.TCOD_random_t
}
func GetRandomInstance ¶
func GetRandomInstance() *Random
func NewRandomFromSeed ¶
func NewRandomFromSeedWithAlgo ¶
func NewRandomFromSeedWithAlgo(seed uint32, algo RandomAlgo) *Random
func NewRandomWithAlgo ¶
func NewRandomWithAlgo(algo RandomAlgo) *Random
func (*Random) GetDoubleMean ¶
func (*Random) GetFloatMean ¶
func (*Random) GetIntMean ¶
func (*Random) SetDistribution ¶
func (self *Random) SetDistribution(distribution Distribution)
type RandomAlgo ¶
type RandomAlgo C.TCOD_random_algo_t
type Renderer ¶
type Renderer C.TCOD_renderer_t
type RootConsole ¶
type RootConsole struct {
Console
}
func NewRootConsole ¶
func NewRootConsole(w, h int, title string, fullscreen bool) *RootConsole
func NewRootConsoleWithFont ¶
func (*RootConsole) CheckForKeypress ¶
func (self *RootConsole) CheckForKeypress(flags int) Key
func (*RootConsole) Credits ¶
func (self *RootConsole) Credits()
func (*RootConsole) DisableKeyboardRepeat ¶
func (self *RootConsole) DisableKeyboardRepeat()
func (*RootConsole) Flush ¶
func (self *RootConsole) Flush()
func (*RootConsole) GetFade ¶
func (self *RootConsole) GetFade() uint8
func (*RootConsole) GetFadingColor ¶
func (self *RootConsole) GetFadingColor() Color
func (*RootConsole) IsFullscreen ¶
func (self *RootConsole) IsFullscreen() bool
func (*RootConsole) IsKeyPressed ¶
func (self *RootConsole) IsKeyPressed(keyCode KeyCode) bool
func (*RootConsole) IsWindowClosed ¶
func (self *RootConsole) IsWindowClosed() bool
func (*RootConsole) MapAsciiCodeToFont ¶
func (self *RootConsole) MapAsciiCodeToFont(asciiCode, fontCharX, fontCharY int)
func (*RootConsole) MapAsciiCodesToFont ¶
func (self *RootConsole) MapAsciiCodesToFont(asciiCode, fontCharX, fontCharY int)
func (*RootConsole) MapStringToFont ¶
func (self *RootConsole) MapStringToFont(s string, fontCharX, fontCharY int)
func (*RootConsole) RenderCredits ¶
func (self *RootConsole) RenderCredits(x, y int, alpha bool) bool
func (*RootConsole) ResetCredits ¶
func (self *RootConsole) ResetCredits()
func (*RootConsole) SetColorControl ¶
func (self *RootConsole) SetColorControl(ctrl ColCtrl, fore, back Color)
func (*RootConsole) SetCustomFont ¶
func (self *RootConsole) SetCustomFont(fontFile string, flags int, nbCharHoriz int, nbCharVertic int)
func (*RootConsole) SetDirty ¶
func (self *RootConsole) SetDirty(x, y, w, h int)
func (*RootConsole) SetFade ¶
func (self *RootConsole) SetFade(val uint8, fade Color)
func (*RootConsole) SetFullscreen ¶
func (self *RootConsole) SetFullscreen(fullscreen bool)
func (*RootConsole) SetKeyboardRepeat ¶
func (self *RootConsole) SetKeyboardRepeat(initialDelay, interval int)
func (*RootConsole) SetWindowTitle ¶
func (self *RootConsole) SetWindowTitle(title string)
func (*RootConsole) WaitForKeypress ¶
func (self *RootConsole) WaitForKeypress(flush bool) Key
type Separator ¶
type Separator struct { Widget // contains filtered or unexported fields }
Separator
func (*Separator) ComputeSize ¶
func (self *Separator) ComputeSize()
type Slider ¶
type Slider struct { TextBox // contains filtered or unexported fields }
func (*Slider) GetCurrentColors ¶
func (*Slider) SetCallback ¶
func (self *Slider) SetCallback(callback SliderCallback, data interface{})
func (*Slider) SetSensitivity ¶
type SliderCallback ¶
type Text ¶
type Text struct {
Data C.TCOD_text_t
}
Text field TODO this is available only in debug version? (1.5.0)
func (*Text) SetProperties ¶
type TextBox ¶
type TextBox struct { Widget // contains filtered or unexported fields }
func (*TextBox) GetBlinkingDelay ¶
func (*TextBox) SetBlinkingDelay ¶
func (*TextBox) SetCallback ¶
func (self *TextBox) SetCallback(callback TextBoxCallback, data interface{})
type TextBoxCallback ¶
type TextBoxStatic ¶
type TextBoxStatic struct {
// contains filtered or unexported fields
}
func NewTextBoxStatic ¶
func NewTextBoxStatic() *TextBoxStatic
type ToggleButton ¶
type ToggleButton struct { Button // contains filtered or unexported fields }
func (*ToggleButton) IsPressed ¶
func (self *ToggleButton) IsPressed() bool
func (*ToggleButton) Render ¶
func (self *ToggleButton) Render(iself IWidget)
func (*ToggleButton) SetPressed ¶
func (self *ToggleButton) SetPressed(val bool)
type ToolBar ¶
type ToolBar struct { Container // contains filtered or unexported fields }
func (*ToolBar) AddSeparator ¶
func (*ToolBar) AddSeparatorWithTip ¶
func (*ToolBar) ComputeSize ¶
func (self *ToolBar) ComputeSize()
func (*ToolBar) GetShouldPrintFrame ¶
func (*ToolBar) SetShouldPrintFrame ¶
type VBox ¶
type VBox struct { Container // contains filtered or unexported fields }
VBox
func (*VBox) ComputeSize ¶
func (self *VBox) ComputeSize()
type Widget ¶
type Widget struct {
// contains filtered or unexported fields
}
func (*Widget) ComputeSize ¶
func (self *Widget) ComputeSize()
func (*Widget) GetCurrentColors ¶
func (*Widget) GetDefaultBackground ¶
func (*Widget) GetDefaultForeground ¶
func (*Widget) GetMouseIn ¶
func (*Widget) GetUserData ¶
func (self *Widget) GetUserData() interface{}
func (*Widget) GetVisible ¶
func (*Widget) SetDefaultBackground ¶
func (*Widget) SetDefaultForeground ¶
func (*Widget) SetMouseIn ¶
func (*Widget) SetUserData ¶
func (self *Widget) SetUserData(data interface{})
func (*Widget) SetVisible ¶
type WidgetCallback ¶
type WidgetCallback func(w IWidget, userData interface{})
type Zip ¶
type Zip struct {
Data C.TCOD_zip_t
}