g2d

package module
v0.0.0-...-59843aa Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: MIT Imports: 19 Imported by: 0

README

g2d

Ebiten-based packaging is mainly used to convert web flash games into local stand-alone games

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Canvas

type Canvas interface{}

渲染画布

type Engine

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

func (*Engine) Draw

func (e *Engine) Draw(screen *ebiten.Image)

渲染

func (*Engine) DrawCircle

func (e *Engine) DrawCircle(cx, cy, r, width int, clr string, fill bool) error

画圆

func (*Engine) DrawLine

func (e *Engine) DrawLine(x0, y0, x1, y1, width int, clr string) error

画线

func (*Engine) DrawRect

func (e *Engine) DrawRect(x, y, w, h, width int, clr string, fill bool) error

画矩形

func (*Engine) GetAudioContext

func (e *Engine) GetAudioContext() (context *audio.Context, sampleRate int)

func (*Engine) GetCanvas

func (e *Engine) GetCanvas() Canvas

func (*Engine) GetFPS

func (e *Engine) GetFPS() float64

取帧率

func (*Engine) GetMouse

func (e *Engine) GetMouse() (x, y int)

取鼠标

func (*Engine) GetSize

func (e *Engine) GetSize() (width, height int)

取大小

func (*Engine) GetTitle

func (e *Engine) GetTitle() string

取标题

func (*Engine) IsKeyPressed

func (e *Engine) IsKeyPressed(key key.Key) bool

func (*Engine) IsMouseButtonPressed

func (e *Engine) IsMouseButtonPressed(key key.MouseButton) bool

func (*Engine) Layout

func (e *Engine) Layout(outsideWidth, outsideHeight int) (screenWidth, screenHeight int)

func (*Engine) LoadGPK

func (e *Engine) LoadGPK(filename, passwd string) error

func (*Engine) Log

func (e *Engine) Log(msg string, err ...error)

记录日志

func (*Engine) ReadGPK

func (e *Engine) ReadGPK(name string) (data []byte, err error)

func (*Engine) Run

func (e *Engine) Run()

启动

func (*Engine) SetDrawCallback

func (e *Engine) SetDrawCallback(cfun EngineDrawCallback)

渲染回调

func (*Engine) SetIcon

func (e *Engine) SetIcon(img []byte) bool

置图标

func (*Engine) SetInitCallback

func (e *Engine) SetInitCallback(cfun EngineInitCallback)

初始化回调

func (*Engine) SetSize

func (e *Engine) SetSize(width, height int)

置大小

func (*Engine) SetTitle

func (e *Engine) SetTitle(title string)

置标题

func (*Engine) SetUpdateCallback

func (e *Engine) SetUpdateCallback(cfun EngineUpdateCallback)

更新回调

func (*Engine) ShowCursor

func (e *Engine) ShowCursor(visible bool)

显示指针

func (*Engine) Update

func (e *Engine) Update() error

更新

func (*Engine) Wheel

func (e *Engine) Wheel() (x, y int)

type EngineDrawCallback

type EngineDrawCallback func(engine *Engine, canvas Canvas)

渲染回调

type EngineInitCallback

type EngineInitCallback func(engine *Engine)

初始化回调,引擎启动之前调用

type EngineUpdateCallback

type EngineUpdateCallback func(engine *Engine) error

更新回调

type Point

type Point struct {
	X int
	Y int
}

type PointF

type PointF struct {
	X float64
	Y float64
}

type RECT

type RECT struct {
	X int
	Y int
	W int
	H int
}

矩形

Directories

Path Synopsis
utils
key

Jump to

Keyboard shortcuts

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