display

package
v1.3.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 28, 2018 License: BSD-3-Clause, BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CeilingShadow added in v0.9.0

func CeilingShadow(x, y int, properties *model.TileProperties, query TilePropertiesQuery) [4]graphics.Color

CeilingShadow returns the colors for the ceiling darkness.

func CeilingTexture added in v0.7.0

func CeilingTexture(properties *model.RealWorldTileProperties) (textureIndex int, textureRotations int)

CeilingTexture returns the information for the ceiling.

func FloorShadow added in v0.9.0

func FloorShadow(x, y int, properties *model.TileProperties, query TilePropertiesQuery) [4]graphics.Color

FloorShadow returns the colors for the floor darkness.

func FloorTexture added in v0.7.0

func FloorTexture(properties *model.RealWorldTileProperties) (textureIndex int, textureRotations int)

FloorTexture returns the information for the floor.

func WallTexture added in v0.7.0

func WallTexture(properties *model.RealWorldTileProperties) (textureIndex int, textureRotations int)

WallTexture returns the information for the wall.

Types

type Area added in v0.3.0

type Area interface {
	Center() (x, y float32)
	Size() (width, height float32)
}

Area describes a rectangular area with a center.

func NewSimpleArea added in v0.4.0

func NewSimpleArea(centerX, centerY float32, width, height float32) Area

NewSimpleArea returns an immutable area with given properties.

type BasicHighlighter added in v0.3.0

type BasicHighlighter struct {
	// contains filtered or unexported fields
}

BasicHighlighter draws a simple highlighting of a rectangular area.

func NewBasicHighlighter added in v0.3.0

func NewBasicHighlighter(context *graphics.RenderContext) *BasicHighlighter

NewBasicHighlighter returns a new instance of BasicHighlighter.

func (*BasicHighlighter) Dispose added in v0.3.0

func (highlighter *BasicHighlighter) Dispose()

Dispose releases all resources.

func (*BasicHighlighter) Render added in v0.3.0

func (highlighter *BasicHighlighter) Render(areas []Area, color graphics.Color)

Render renders the highlights.

type ColorQuery added in v0.9.0

type ColorQuery func(x, y int, properties *model.TileProperties, query TilePropertiesQuery) [4]graphics.Color

ColorQuery returns the 4 colors for the specified tile. Returned order: bottom-left, top-left, top-right, bottom-right.

type Context added in v0.4.0

type Context interface {
	ModelAdapter() *model.Adapter
	NewRenderContext(viewMatrix *mgl.Mat4) *graphics.RenderContext
	ForGraphics() graphics.Context
}

Context provides some global resources.

type GridRenderable

type GridRenderable struct {
	// contains filtered or unexported fields
}

GridRenderable renders a grid with transparent holes.

func NewGridRenderable

func NewGridRenderable(context *graphics.RenderContext) *GridRenderable

NewGridRenderable returns a new instance of GridRenderable.

func (*GridRenderable) Render

func (renderable *GridRenderable) Render()

Render renders

type MapDisplay added in v0.4.0

type MapDisplay struct {
	// contains filtered or unexported fields
}

MapDisplay is a display for a level map

func NewMapDisplay added in v0.4.0

func NewMapDisplay(context Context, parent *ui.Area, scale float32) *MapDisplay

NewMapDisplay returns a new instance.

func (*MapDisplay) ClearHighlightedTile added in v0.4.0

func (display *MapDisplay) ClearHighlightedTile()

ClearHighlightedTile requests to remove any tile highlight.

func (*MapDisplay) SetDisplayedObjects added in v0.4.0

func (display *MapDisplay) SetDisplayedObjects(objects []*model.LevelObject)

SetDisplayedObjects requests to show the given set of objects.

func (*MapDisplay) SetHighlightedObject added in v0.4.0

func (display *MapDisplay) SetHighlightedObject(object *model.LevelObject)

SetHighlightedObject registers an object that shall be highlighted.

func (*MapDisplay) SetHighlightedTile added in v0.4.0

func (display *MapDisplay) SetHighlightedTile(coord model.TileCoordinate)

SetHighlightedTile requests to highlight the identified tile.

func (*MapDisplay) SetSelectedObjects added in v0.4.0

func (display *MapDisplay) SetSelectedObjects(objects []*model.LevelObject)

SetSelectedObjects requests to show the given set of objects as selected.

func (*MapDisplay) SetSelectedTiles added in v0.4.0

func (display *MapDisplay) SetSelectedTiles(tiles []model.TileCoordinate)

SetSelectedTiles requests to show the given set of tiles as selected.

func (*MapDisplay) SetTextureIndexQuery added in v0.7.0

func (display *MapDisplay) SetTextureIndexQuery(query TextureIndexQuery)

SetTextureIndexQuery sets which texture shall be shown.

func (*MapDisplay) SetTileColoring added in v0.9.0

func (display *MapDisplay) SetTileColoring(colorQuery ColorQuery)

SetTileColoring sets the query function for coloring tiles.

func (*MapDisplay) SetVisible added in v0.4.0

func (display *MapDisplay) SetVisible(visible bool)

SetVisible sets the display visibility state.

func (*MapDisplay) WorldCoordinatesForPixel added in v0.4.0

func (display *MapDisplay) WorldCoordinatesForPixel(pixelX, pixelY float32) (x, y float32)

WorldCoordinatesForPixel returns the world coordinates at the given pixel position.

type PlacedIcon added in v0.3.0

type PlacedIcon interface {
	Center() (x, y float32)
	Texture() *graphics.BitmapTexture
}

PlacedIcon is an icon bitmap with a location.

type PlacedIconsRenderable added in v0.4.0

type PlacedIconsRenderable struct {
	// contains filtered or unexported fields
}

PlacedIconsRenderable is a renderable for simple bitmaps.

func NewPlacedIconsRenderable added in v0.4.0

func NewPlacedIconsRenderable(context *graphics.RenderContext, paletteTexture graphics.Texture) *PlacedIconsRenderable

NewPlacedIconsRenderable returns a new instance of a simple bitmap renderable

func (*PlacedIconsRenderable) Render added in v0.4.0

func (renderable *PlacedIconsRenderable) Render(icons []PlacedIcon)

Render renders the icons with their center at given position

type TextureIndexQuery added in v0.7.0

type TextureIndexQuery func(properties *model.RealWorldTileProperties) (textureIndex int, textureRotations int)

TextureIndexQuery is a getter function to retrieve the texture index and rotations from given tile properties.

type TextureQuery

type TextureQuery func(index int) *graphics.BitmapTexture

TextureQuery is a getter function to retrieve the texture for the given level texture index.

type TileColorMapRenderable added in v0.9.0

type TileColorMapRenderable struct {
	// contains filtered or unexported fields
}

TileColorMapRenderable is a renderable for the tile colorings.

func NewTileColorMapRenderable added in v0.9.0

func NewTileColorMapRenderable(context *graphics.RenderContext) *TileColorMapRenderable

NewTileColorMapRenderable returns a new instance of a renderable for tile colorings.

func (*TileColorMapRenderable) Clear added in v0.9.0

func (renderable *TileColorMapRenderable) Clear()

Clear resets all tiles.

func (*TileColorMapRenderable) Dispose added in v0.9.0

func (renderable *TileColorMapRenderable) Dispose()

Dispose releases any internal resources

func (*TileColorMapRenderable) Render added in v0.9.0

func (renderable *TileColorMapRenderable) Render()

Render renders

func (*TileColorMapRenderable) SetColorQuery added in v0.9.0

func (renderable *TileColorMapRenderable) SetColorQuery(colorQuery ColorQuery)

SetColorQuery sets the query function for the coloring. nil disables coloring.

func (*TileColorMapRenderable) SetTile added in v0.9.0

func (renderable *TileColorMapRenderable) SetTile(x, y int, properties *model.TileProperties)

SetTile sets the properties for the specified tile coordinate.

type TileGridMapRenderable

type TileGridMapRenderable struct {
	// contains filtered or unexported fields
}

TileGridMapRenderable is a renderable for the tile grid.

func NewTileGridMapRenderable

func NewTileGridMapRenderable(context *graphics.RenderContext) *TileGridMapRenderable

NewTileGridMapRenderable returns a new instance of a renderable for tile grids.

func (*TileGridMapRenderable) Clear

func (renderable *TileGridMapRenderable) Clear()

Clear resets all tiles.

func (*TileGridMapRenderable) Dispose

func (renderable *TileGridMapRenderable) Dispose()

Dispose releases any internal resources

func (*TileGridMapRenderable) Render

func (renderable *TileGridMapRenderable) Render()

Render renders

func (*TileGridMapRenderable) SetTile

func (renderable *TileGridMapRenderable) SetTile(x, y int, properties *model.TileProperties)

SetTile sets the properties for the specified tile coordinate.

type TilePropertiesQuery added in v0.9.0

type TilePropertiesQuery func(x, y int) *model.TileProperties

TilePropertiesQuery is a function to return the properties of requested tile, or nil if not available.

type TileSlopeMapRenderable added in v0.9.0

type TileSlopeMapRenderable struct {
	// contains filtered or unexported fields
}

TileSlopeMapRenderable is a renderable for the tile slopes.

func NewTileSlopeMapRenderable added in v0.9.0

func NewTileSlopeMapRenderable(context *graphics.RenderContext) *TileSlopeMapRenderable

NewTileSlopeMapRenderable returns a new instance of a renderable for tile slopes.

func (*TileSlopeMapRenderable) Clear added in v0.9.0

func (renderable *TileSlopeMapRenderable) Clear()

Clear resets all tiles.

func (*TileSlopeMapRenderable) Dispose added in v0.9.0

func (renderable *TileSlopeMapRenderable) Dispose()

Dispose releases any internal resources

func (*TileSlopeMapRenderable) Render added in v0.9.0

func (renderable *TileSlopeMapRenderable) Render()

Render renders

func (*TileSlopeMapRenderable) SetTile added in v0.9.0

func (renderable *TileSlopeMapRenderable) SetTile(x, y int, properties *model.TileProperties)

SetTile sets the properties for the specified tile coordinate.

type TileTextureMapRenderable

type TileTextureMapRenderable struct {
	// contains filtered or unexported fields
}

TileTextureMapRenderable is a renderable for textures.

func NewTileTextureMapRenderable

func NewTileTextureMapRenderable(context *graphics.RenderContext, paletteTexture graphics.Texture,
	textureQuery TextureQuery) *TileTextureMapRenderable

NewTileTextureMapRenderable returns a new instance of a renderable for tile map textures.

func (*TileTextureMapRenderable) Clear

func (renderable *TileTextureMapRenderable) Clear()

Clear resets all tiles.

func (*TileTextureMapRenderable) Dispose

func (renderable *TileTextureMapRenderable) Dispose()

Dispose releases any internal resources

func (*TileTextureMapRenderable) Render

func (renderable *TileTextureMapRenderable) Render()

Render renders

func (*TileTextureMapRenderable) SetTextureIndexQuery added in v0.7.0

func (renderable *TileTextureMapRenderable) SetTextureIndexQuery(query TextureIndexQuery)

SetTextureIndexQuery sets which texture shall be shown.

func (*TileTextureMapRenderable) SetTile

func (renderable *TileTextureMapRenderable) SetTile(x, y int, properties *model.TileProperties)

SetTile sets the properties for the specified tile coordinate.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL