mapgen

package
v0.0.0-...-cc3c48a Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FontCache

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

FontCache はフォントデータを格納する構造体。

func NewFontCache

func NewFontCache() *FontCache

NewFontCache は新しいフォントデータの格納先を返す。

func (*FontCache) Load

func (fc *FontCache) Load(fd draw2d.FontData) (*truetype.Font, error)

Load はフォントキャッシュからフォントデータを読み出す。

func (*FontCache) Store

func (fc *FontCache) Store(fd draw2d.FontData, font *truetype.Font)

Store はフォントキャッシュにフォントデータを格納する。

func (*FontCache) StoreFontDataFromFile

func (fc *FontCache) StoreFontDataFromFile(fontPath string) error

フォントファイルからデータを読み、格納する。

type SquareMapImage

type SquareMapImage struct {
	// Map は描画対象のスクエアマップ。
	Map *rpgmap.SquareMap
	// FontCache はフォントの格納先。
	FontCache *FontCache
	// GridWidth は1マスの幅。
	GridWidth int
	// GridHeight は1マスの高さ。
	GridHeight int

	// BackgroundColor はマップの背景色。
	BackgroundColor color.RGBA
	// GridColor はグリッドの線の色。
	GridColor color.RGBA
	// contains filtered or unexported fields
}

SquareMapImage はスクエアマップの画像描画に必要な情報の構造体。

func NewSquareMapImage

func NewSquareMapImage(m *rpgmap.SquareMap, fc *FontCache) *SquareMapImage

NewSquareMapImage は新しいスクエアマップ描画情報を返す。

func (*SquareMapImage) Height

func (img *SquareMapImage) Height() int

Height は画像の高さを返す。

func (*SquareMapImage) Render

func (i *SquareMapImage) Render() (*image.RGBA, error)

Render はマップを描画する。

func (*SquareMapImage) Width

func (img *SquareMapImage) Width() int

Width は画像の幅を返す。

Jump to

Keyboard shortcuts

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