Documentation ¶
Overview ¶
Code generated for package gfx by go-bindata DO NOT EDIT. (@generated) sources: JetBrainsMono-2.242/.DS_Store JetBrainsMono-2.242/AUTHORS.txt JetBrainsMono-2.242/OFL.txt JetBrainsMono-2.242/fonts/.DS_Store JetBrainsMono-2.242/fonts/ttf/JetBrainsMono-Bold.ttf JetBrainsMono-2.242/fonts/ttf/JetBrainsMono-BoldItalic.ttf JetBrainsMono-2.242/fonts/ttf/JetBrainsMono-ExtraBold.ttf JetBrainsMono-2.242/fonts/ttf/JetBrainsMono-ExtraBoldItalic.ttf JetBrainsMono-2.242/fonts/ttf/JetBrainsMono-ExtraLight.ttf JetBrainsMono-2.242/fonts/ttf/JetBrainsMono-ExtraLightItalic.ttf JetBrainsMono-2.242/fonts/ttf/JetBrainsMono-Italic.ttf JetBrainsMono-2.242/fonts/ttf/JetBrainsMono-Light.ttf JetBrainsMono-2.242/fonts/ttf/JetBrainsMono-LightItalic.ttf JetBrainsMono-2.242/fonts/ttf/JetBrainsMono-Medium.ttf JetBrainsMono-2.242/fonts/ttf/JetBrainsMono-MediumItalic.ttf JetBrainsMono-2.242/fonts/ttf/JetBrainsMono-Regular.ttf JetBrainsMono-2.242/fonts/ttf/JetBrainsMono-SemiBold.ttf JetBrainsMono-2.242/fonts/ttf/JetBrainsMono-SemiBoldItalic.ttf JetBrainsMono-2.242/fonts/ttf/JetBrainsMono-Thin.ttf JetBrainsMono-2.242/fonts/ttf/JetBrainsMono-ThinItalic.ttf JetBrainsMono-2.242/fonts/ttf/JetBrainsMonoNL-Bold.ttf JetBrainsMono-2.242/fonts/ttf/JetBrainsMonoNL-BoldItalic.ttf JetBrainsMono-2.242/fonts/ttf/JetBrainsMonoNL-ExtraBold.ttf JetBrainsMono-2.242/fonts/ttf/JetBrainsMonoNL-ExtraBoldItalic.ttf JetBrainsMono-2.242/fonts/ttf/JetBrainsMonoNL-ExtraLight.ttf JetBrainsMono-2.242/fonts/ttf/JetBrainsMonoNL-ExtraLightItalic.ttf JetBrainsMono-2.242/fonts/ttf/JetBrainsMonoNL-Italic.ttf JetBrainsMono-2.242/fonts/ttf/JetBrainsMonoNL-Light.ttf JetBrainsMono-2.242/fonts/ttf/JetBrainsMonoNL-LightItalic.ttf JetBrainsMono-2.242/fonts/ttf/JetBrainsMonoNL-Medium.ttf JetBrainsMono-2.242/fonts/ttf/JetBrainsMonoNL-MediumItalic.ttf JetBrainsMono-2.242/fonts/ttf/JetBrainsMonoNL-Regular.ttf JetBrainsMono-2.242/fonts/ttf/JetBrainsMonoNL-SemiBold.ttf JetBrainsMono-2.242/fonts/ttf/JetBrainsMonoNL-SemiBoldItalic.ttf JetBrainsMono-2.242/fonts/ttf/JetBrainsMonoNL-Thin.ttf JetBrainsMono-2.242/fonts/ttf/JetBrainsMonoNL-ThinItalic.ttf JetBrainsMono-2.242/fonts/variable/JetBrainsMono-Italic[wght].ttf JetBrainsMono-2.242/fonts/variable/JetBrainsMono[wght].ttf JetBrainsMono-2.242/fonts/webfonts/JetBrainsMono-Bold.woff2 JetBrainsMono-2.242/fonts/webfonts/JetBrainsMono-BoldItalic.woff2 JetBrainsMono-2.242/fonts/webfonts/JetBrainsMono-ExtraBold.woff2 JetBrainsMono-2.242/fonts/webfonts/JetBrainsMono-ExtraBoldItalic.woff2 JetBrainsMono-2.242/fonts/webfonts/JetBrainsMono-ExtraLight.woff2 JetBrainsMono-2.242/fonts/webfonts/JetBrainsMono-ExtraLightItalic.woff2 JetBrainsMono-2.242/fonts/webfonts/JetBrainsMono-Italic.woff2 JetBrainsMono-2.242/fonts/webfonts/JetBrainsMono-Light.woff2 JetBrainsMono-2.242/fonts/webfonts/JetBrainsMono-LightItalic.woff2 JetBrainsMono-2.242/fonts/webfonts/JetBrainsMono-Medium.woff2 JetBrainsMono-2.242/fonts/webfonts/JetBrainsMono-MediumItalic.woff2 JetBrainsMono-2.242/fonts/webfonts/JetBrainsMono-Regular.woff2 JetBrainsMono-2.242/fonts/webfonts/JetBrainsMono-SemiBold.woff2 JetBrainsMono-2.242/fonts/webfonts/JetBrainsMono-SemiBoldItalic.woff2 JetBrainsMono-2.242/fonts/webfonts/JetBrainsMono-Thin.woff2 JetBrainsMono-2.242/fonts/webfonts/JetBrainsMono-ThinItalic.woff2
Index ¶
- Constants
- Variables
- func Asset(name string) ([]byte, error)
- func AssetDir(name string) ([]string, error)
- func AssetInfo(name string) (os.FileInfo, error)
- func AssetNames() []string
- func CompileShader(source string, shaderType uint32) (uint32, error)
- func MustAsset(name string) []byte
- func NewProgram(vertexShaderSource, fragmentShaderSource string) (uint32, error)
- func RestoreAsset(dir, name string) error
- func RestoreAssets(dir, name string) error
- type App
- func (app *App) AppExit(w *glfw.Window)
- func (app *App) CalcFps()
- func (app *App) CharTyped(w *glfw.Window, char rune)
- func (app *App) CompleteDrag()
- func (app *App) FadeDone()
- func (app *App) FadeIn(fx func())
- func (app *App) FadeOut(fx func())
- func (app *App) GetScreenPos(x, y, z int) (int, int)
- func (app *App) HideCursorShape()
- func (app *App) IsDown(key glfw.Key) bool
- func (app *App) IsDownAlt(key1, key2 glfw.Key) bool
- func (app *App) IsDownAlt1(key1 glfw.Key) bool
- func (app *App) IsDownMod(key glfw.Key, mod glfw.ModifierKey) bool
- func (app *App) IsFirstDown(key glfw.Key) bool
- func (app *App) IsFirstDownMod(key glfw.Key, mod glfw.ModifierKey) bool
- func (app *App) Keypressed(w *glfw.Window, key glfw.Key, scancode int, action glfw.Action, ...)
- func (app *App) LoadMap(name string) (*map[string]interface{}, error)
- func (app *App) MouseClick(w *glfw.Window, button glfw.MouseButton, action glfw.Action, ...)
- func (app *App) MousePos(w *glfw.Window, xpos float64, ypos float64)
- func (app *App) MouseScroll(w *glfw.Window, xoffs, yoffs float64)
- func (app *App) PanelAtMouse() (*Panel, int, int)
- func (app *App) Print()
- func (app *App) Run()
- func (app *App) SaveMap(name string, m map[string]interface{}) error
- func (app *App) SetCursor(name string)
- func (app *App) SetCursorShape(img image.Image)
- func (app *App) SetCursorTmp(name string)
- func (app *App) SetTimer(secs float64, fx string)
- func (app *App) Sleep(lastTime float64) (float64, float64)
- func (app *App) StartApp(game Game, gameDir string) *App
- func (app *App) ToggleConsole()
- func (app *App) Walk()
- type AppConfig
- type Area
- type Audio
- type Block
- type BlockPos
- type BoundingBox
- type DrawState
- type Fade
- type Font
- type FrameBuffer
- type Game
- type KeyPress
- type LayerConfig
- type Panel
- type PathNode
- type PathStep
- type ShaderCode
- type SoundEffect
- type SoundInfo
- type Template
- type Term
- type Texture
- type TimerCall
- type Ui
- func (ui *Ui) Add(x, y, w, h int, renderer func(*Panel) bool) *Panel
- func (ui *Ui) AddBg(x, y, w, h int, bg color.Color, renderer func(*Panel) bool) *Panel
- func (ui *Ui) Draw()
- func (ui *Ui) GetTop() *Panel
- func (ui *Ui) MovePanel(panel *Panel, x, y int)
- func (ui *Ui) NewPanel(x, y, w, h int, bg color.Color, renderer func(*Panel) bool) *Panel
- func (ui *Ui) PanelAt(x, y int) (*Panel, int, int)
- func (ui *Ui) Raise(panel *Panel)
- func (ui *Ui) Remove(panel *Panel)
- type View
- func (view *View) AddPathThroughShape(shape *shapes.Shape)
- func (view *View) CanFit(toWorldX, toWorldY, toWorldZ int, shape *shapes.Shape, ...) bool
- func (view *View) CanMoveArea(worldX, worldY, worldZ, xSize, ySize, zSize, dx, dy, dz int) bool
- func (view *View) Draw(delta, time float64, selectMode bool)
- func (view *View) DrawLayer(index int, delta float64)
- func (view *View) EnableLayer(index int, enabled bool)
- func (view *View) EraseShape(worldX, worldY, worldZ int) (*BlockPos, int)
- func (view *View) EraseShapeExact(worldX, worldY, worldZ int) (*BlockPos, int)
- func (view *View) FindPath(sx, sy, sz, ex, ey, ez int, isFlying bool, dSrc, dDst, maxSteps int) []PathStep
- func (view *View) FindTop(worldX, worldY int, shape *shapes.Shape) int
- func (view *View) GetBlockPos(worldX, worldY, worldZ int) *BlockPos
- func (view *View) GetBlocker(toWorldX, toWorldY, toWorldZ int) *BlockPos
- func (view *View) GetClick() [3]int
- func (view *View) GetClosestSurfacePoint(mouseVector mgl32.Vec2, shape *shapes.Shape, ...) (int, int, int, bool)
- func (view *View) GetLayerFade(index int) float32
- func (view *View) GetLocations(shapeIndex int) [][3]int
- func (view *View) GetMaxZ() int
- func (view *View) GetRescuePosition(destX, destY, destZ int, shape *shapes.Shape, dist int) [3]int
- func (view *View) GetShape(worldX, worldY, worldZ int) (int, int, int, int, bool)
- func (view *View) GetShapeExactAt(viewX, viewY, viewZ int) *shapes.Shape
- func (view *View) HideCursor()
- func (view *View) InView(worldX, worldY, worldZ int) bool
- func (view *View) InVisibleView(worldX, worldY, worldZ int) bool
- func (view *View) IsActivatable(worldX, worldY, worldZ int) bool
- func (view *View) IsAnimatedReachable(worldX, worldY, worldZ int, shape *shapes.Shape, ignoreAnimated bool) bool
- func (view *View) IsEmpty(toWorldX, toWorldY, toWorldZ int, shape *shapes.Shape) bool
- func (view *View) IsReachable(worldX, worldY, worldZ int, shape *shapes.Shape) bool
- func (view *View) Load()
- func (view *View) MoveArea(worldX, worldY, worldZ, xSize, ySize, zSize, dx, dy, dz int) bool
- func (view *View) MoveShape(worldX, worldY, worldZ, newWorldX, newWorldY int, isFlying bool) (int, int, int, int)
- func (view *View) Scroll(dx, dy, dz float32)
- func (view *View) SetClick(worldX, worldY, worldZ int)
- func (view *View) SetCursor(shapeIndex int, z int)
- func (view *View) SetDaylight(r, g, b, a float32)
- func (view *View) SetMarked(worldX, worldY, worldZ int, marked bool)
- func (view *View) SetMaxZ(z int)
- func (view *View) SetOffset(worldX, worldY, worldZ int, dx, dy float32)
- func (view *View) SetPlayerLightMode(mode int)
- func (view *View) SetShape(worldX, worldY, worldZ int, shapeIndex int) *BlockPos
- func (view *View) SetShapeAnimation(worldX, worldY, worldZ int, animationType int, dir shapes.Direction)
- func (view *View) SetShapeState(worldX, worldY, worldZ int, state int32) *BlockPos
- func (view *View) SetUnderShape(shape *shapes.Shape, negativeShape *shapes.Shape)
- func (view *View) SetZoom(zoom float64)
- func (view *View) UpdateReachable(worldX, worldY, worldZ, radius int, testReachableShape *shapes.Shape)
- func (view *View) Zoom(zoom float64)
- type ViewContext
- type ViewLayer
- type ViewShader
Constants ¶
const ( SEARCH_SIZE = 16 REACH_SIZE = 8 DEBUG_REACHABLE = false )
const FADE_SECS = float64(0.5)
const LAYER_MAX_FADE = 0.5
const MAX_TIME = 1000
const NEAR_SILENCE = -10
const USER_DEFINED_CALLS = "// USER_DEFINED_CALLS"
const USER_DEFINED_PROTO = "// USER_DEFINED_PROTO"
const VERSION = "0.1"
Variables ¶
var DAYLIGHT_ONE [4]float32 = [4]float32{1, 1, 1, 1}
var ZERO_OFFSET [2]float32
Functions ¶
func Asset ¶
Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.
func AssetDir ¶
AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:
data/ foo.txt img/ a.png b.png
then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.
func AssetInfo ¶
AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.
func MustAsset ¶
MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.
func NewProgram ¶
func RestoreAsset ¶
RestoreAsset restores an asset under the given directory
func RestoreAssets ¶
RestoreAssets restores an asset under the given directory recursively
Types ¶
type App ¶
type App struct { Game Game Fonts []*Font Config *AppConfig Window *glfw.Window KeyState map[glfw.Key]*KeyPress RecordChars bool RecordCharsKey glfw.Key CharBuffer strings.Builder View *View ViewVisible bool Ui *Ui Dir string Loader *world.Loader Width, Height int MouseX, MouseY int32 MousePixelX, MousePixelY int32 MouseButtonDown int32 DragStartX, DragStartY int32 MouseButtonAction int Dragging bool DraggedPanel *Panel DraggedPanelOffsX, DraggedPanelOffsY int DragAction string DragIndex int Loading bool Cursors map[string]*glfw.Cursor Console *Term Shaders map[string]*ShaderCode Audio *Audio // contains filtered or unexported fields }
func (*App) CompleteDrag ¶
func (app *App) CompleteDrag()
func (*App) HideCursorShape ¶
func (app *App) HideCursorShape()
func (*App) IsFirstDownMod ¶
func (*App) Keypressed ¶
func (*App) MouseClick ¶
func (app *App) MouseClick(w *glfw.Window, button glfw.MouseButton, action glfw.Action, mods glfw.ModifierKey)
func (*App) SetCursorShape ¶
func (*App) SetCursorTmp ¶
func (*App) ToggleConsole ¶
func (app *App) ToggleConsole()
type Audio ¶
type Audio struct { Sounds map[string]*SoundEffect Music map[string]*SoundEffect // contains filtered or unexported fields }
func (*Audio) StartMusic ¶
type Block ¶
type Block struct {
// contains filtered or unexported fields
}
Block is a displayed Shape
type BlockPos ¶
type BlockPos struct { ScrollOffset [2]float32 // contains filtered or unexported fields }
BlockPos is a displayed Shape at a location
type BoundingBox ¶
func (*BoundingBox) Set ¶
func (bb *BoundingBox) Set(x, y, z, w, h, d int)
func (*BoundingBox) SetPos ¶
func (bb *BoundingBox) SetPos(x, y, z int)
type Font ¶
type Font struct { Height int // contains filtered or unexported fields }
func NewFontData ¶
func (*Font) ColorPrintf ¶
type FrameBuffer ¶
type FrameBuffer struct { FrameBuffer uint32 // contains filtered or unexported fields }
func NewFrameBuffer ¶
func NewFrameBuffer(width, height int32, useAspectRatio, accum bool, layerFragmentShader string) *FrameBuffer
func (*FrameBuffer) Draw ¶
func (fb *FrameBuffer) Draw(fade float32, prevFbTexture, prevFbDepth *FrameBuffer, time float32, daylight [4]float32, destFb *FrameBuffer)
func (*FrameBuffer) Enable ¶
func (fb *FrameBuffer) Enable()
func (*FrameBuffer) EnableWH ¶
func (fb *FrameBuffer) EnableWH(w, h int)
type Game ¶
type Game interface { Init(app *App, config map[string]interface{}) Exit() Name() string Events(delta float64, fadeDir int, mouseX, mouseY, mouseWorldX, mouseWorldY, mouseWorldZ, mouseButtonDown int32, mouseOnInteractive bool) GetZ() int DragFromUi(pixelX, pixelY int) (string, int) CanZoom() bool ViewSize() int RunFx(name string) Eval(cmd string) (interface{}, error) Walk(sx, sy int) }
type LayerConfig ¶
type Panel ¶
type Panel struct {
X, Y, W, H int
Background color.Color
Visible bool
Rgba *image.RGBA
Draggable bool
// contains filtered or unexported fields
}
func (*Panel) ClearWithColor ¶
type ShaderCode ¶
type SoundEffect ¶
type SoundEffect struct {
// contains filtered or unexported fields
}
type Term ¶
type Term struct {
Width, Height int
Font *Font
Panel *Panel
Update bool
Messages []string
Focus bool
// contains filtered or unexported fields
}
type Ui ¶
type Ui struct {
ScreenWidth, ScreenHeight float32
// contains filtered or unexported fields
}
type View ¶
type View struct {
Size, DrawSize int
Loader *world.Loader
Cursor *BlockPos
ScrollOffset [3]float32
DidClick bool
HideSectionMarker bool
// contains filtered or unexported fields
}
func (*View) AddPathThroughShape ¶
func (*View) CanMoveArea ¶
see if the area could move to its final location
func (*View) EnableLayer ¶
func (*View) EraseShapeExact ¶
func (*View) GetBlockPos ¶
func (*View) GetBlocker ¶
func (*View) GetClosestSurfacePoint ¶
func (*View) GetLayerFade ¶
func (*View) GetLocations ¶
find all locations of shapeIndex
func (*View) GetRescuePosition ¶
func (*View) GetShapeExactAt ¶
debug method
func (*View) HideCursor ¶
func (view *View) HideCursor()
func (*View) InVisibleView ¶
func (*View) IsActivatable ¶
is there a reachable location "next" to this position?
func (*View) IsAnimatedReachable ¶
func (*View) IsReachable ¶
func (*View) MoveArea ¶
Move an area (a 3d block) of the view. Returns true if the area moved "fits".
func (*View) MoveShape ¶
func (view *View) MoveShape(worldX, worldY, worldZ, newWorldX, newWorldY int, isFlying bool) (int, int, int, int)
Move a shape from (worldX, worldY, worldZ) to a new position of (newWorldX, newWorldY). Returns the new Z value, or -1 if the shape won't fit.
func (*View) SetDaylight ¶
func (*View) SetPlayerLightMode ¶
func (*View) SetShapeAnimation ¶
func (*View) SetShapeState ¶
func (*View) SetUnderShape ¶
func (*View) UpdateReachable ¶
type ViewContext ¶
type ViewContext struct {
// contains filtered or unexported fields
}
type ViewLayer ¶
type ViewLayer struct { Size [3]float32 ScrollOffset [3]float32 Enabled bool Fade float32 FadeTime float32 RenderMarked bool // contains filtered or unexported fields }
func (*ViewLayer) Draw ¶
func (layer *ViewLayer) Draw(view *View, shader *ViewShader)
type ViewShader ¶
type ViewShader struct {
// contains filtered or unexported fields
}