Documentation
¶
Index ¶
- Constants
- func BlendOver(src, dst color.RGBA) color.RGBA
- func BuildFloorStack(floor int) []uint8
- func DrawSpriteScaled(dst *image.RGBA, src *image.RGBA, dstX, dstY, outW, outH int) bool
- func EncodePNG(img *image.RGBA) ([]byte, error)
- func From8Bit(c uint8) color.RGBA
- func GameTilesForZoom(zoom int) int
- type Renderer
Constants ¶
const MaxTileZoom = 5
MaxTileZoom is the highest zoom level for which we generate tiles server-side.
const SpritePixels = 32
SpritePixels is the native sprite resolution in the SPR file.
const SpriteZoomThreshold = 3
SpriteZoomThreshold is the zoom level at which sprite rendering begins. Below this, minimap colors (single floor, no stacking). At and above, actual sprites with floor stacking.
const TileSize = 256
Variables ¶
This section is empty.
Functions ¶
func BuildFloorStack ¶
BuildFloorStack returns the floor rendering order for sprite compositing.
func DrawSpriteScaled ¶
DrawSpriteScaled draws a sprite onto the output image with nearest-neighbor scaling.
func From8Bit ¶
From8Bit converts an 8-bit Tibia minimap color index to RGBA. The color space uses a 6x6x6 color cube (216 colors).
func GameTilesForZoom ¶
GameTilesForZoom returns how many game tiles one 256px tile covers at the given zoom.
Types ¶
type Renderer ¶
type Renderer struct {
// contains filtered or unexported fields
}
Renderer produces 256x256 map tile PNGs. All methods are thread-safe (read-only access to shared data).
func NewRenderer ¶
func (*Renderer) RenderMinimapImage ¶
RenderMinimapImage renders a minimap-colored image for the given tile data region. Useful for services that need an image.RGBA directly instead of PNG bytes.