sdl2

package
v0.0.0-...-135b9b9 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2019 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IMAGE_SIZE = 10 //像素的大小
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Line

type Line struct {
	Color      [4]uint8
	StartPoint *Point2D
	EndPoint   *Point2D
}

func GetNewLine

func GetNewLine(r, g, b, a uint8, startX, startY, endX, endY int32) *Line

func (*Line) Destroy

func (l *Line) Destroy()

func (*Line) Draw

func (l *Line) Draw(renderer *sdl.Renderer)

type LineMgr

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

颜色款式相同个的线

func GetNewLineMgr

func GetNewLineMgr() *LineMgr

func (*LineMgr) AddList

func (lm *LineMgr) AddList(args *list.List)

func (*LineMgr) AddOneMore

func (lm *LineMgr) AddOneMore(args ...*Line)

func (*LineMgr) Destroy

func (lm *LineMgr) Destroy()

func (*LineMgr) Draw

func (lm *LineMgr) Draw()

func (*LineMgr) Init

func (lm *LineMgr) Init(renderer *sdl.Renderer)

type MapInfo

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

type MapMgr

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

func GetNewMapMgr

func GetNewMapMgr(winWidth, winHeight, mapWidth, mapHeight int32, renderer *sdl.Renderer) *MapMgr

func (*MapMgr) Destroy

func (mm *MapMgr) Destroy()

func (*MapMgr) Draw

func (mm *MapMgr) Draw(pos [2]int32)

func (*MapMgr) Load

func (mm *MapMgr) Load(path string, index int)

type Point2D

type Point2D struct {
	X int32
	Y int32
}

type RectMgr

type RectMgr struct {
	RectList *list.List
	Renderer *sdl.Renderer
}

func GetNewRectMgr

func GetNewRectMgr() *RectMgr

func (*RectMgr) Add

func (rm *RectMgr) Add(args ...*sdl.Rect)

func (*RectMgr) Destroy

func (rm *RectMgr) Destroy()

func (*RectMgr) Draw

func (rm *RectMgr) Draw()

func (*RectMgr) DrawRectNow

func (rm *RectMgr) DrawRectNow(r, g, b, a uint8, args ...*sdl.Rect)

func (*RectMgr) Init

func (rm *RectMgr) Init(renderer *sdl.Renderer)

type Text

type Text struct {
	Font *ttf.Font
}

func GetNewText

func GetNewText(path string, size int) *Text

func (*Text) Destroy

func (tx *Text) Destroy()

func (*Text) RenderUTF8Blended

func (tx *Text) RenderUTF8Blended(input string, color sdl.Color, render *sdl.Renderer, wrapLength int, x, y int32)

type Wnd

type Wnd struct {
	Wdw    *sdl.Window
	Render *sdl.Renderer
}

func GetNewWindow

func GetNewWindow(title string, x, y, w, h int32, flag uint32, index int, flag1 uint32) *Wnd

func (*Wnd) CreateRenderer

func (wnd *Wnd) CreateRenderer(index int, flags uint32)

func (*Wnd) Destroy

func (wnd *Wnd) Destroy()

Jump to

Keyboard shortcuts

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