Documentation ¶
Index ¶
- Variables
- func AddAfterLoopSub(sub afterLooper) error
- func DelAfterLoopSub(sub afterLooper) error
- func DrawRect(img *ebiten.Image, rect Rect, clr color.Color)
- func GetFace(name string, size float64) (font.Face, error)
- func GetTempImage(w, h int) *ebiten.Image
- func PutPoolTex(tex Tex)
- func PutTempImage(tex *ebiten.Image)
- func ResetFaceCache()
- func Run(mainLoop func(win *ebiten.Image, dt float64) error, width, height int, ...) error
- func ScreenSize() (w, h int)
- func SetFaceLoader(loader FaceLoaderF)
- func SetShrink(shrinkPeriod, shrinkReserve, shrinkLimit int)
- func SetTexLoader(f TexLoaderF)
- func TexCacheReset()
- func TransformUpVector(t VTransformer) vec2.V2
- func TransformVector(t VTransformer, v vec2.V2) vec2.V2
- func UID() uint64
- func Vertex(v2 vec2.V2) ebiten.Vertex
- func VertexColor(v2 vec2.V2, clr color.Color) ebiten.Vertex
- type Align
- type Camera
- func (c *Camera) Angle() float64
- func (c *Camera) Apply(x, y float64) (float64, float64)
- func (c *Camera) ApplyPoint(v vec2.V2) vec2.V2
- func (c *Camera) Center() vec2.V2
- func (c *Camera) ClipRect() image.Rectangle
- func (c *Camera) ClippedRect(rect Rect) bool
- func (c *Camera) Local() RTransformer
- func (c *Camera) Mark() RTransformer
- func (c *Camera) MulScale(scaleK float64)
- func (c *Camera) NoRot() RTransformer
- func (c *Camera) NoScale() RTransformer
- func (c *Camera) Phys() RTransformer
- func (c *Camera) Pos() vec2.V2
- func (c *Camera) Rotate(ang float64)
- func (c *Camera) Scale() float64
- func (c *Camera) SetAng(v float64)
- func (c *Camera) SetCenter(v vec2.V2)
- func (c *Camera) SetClipRect(rect image.Rectangle)
- func (c *Camera) SetPos(v vec2.V2)
- func (c *Camera) SetScale(v float64)
- func (c *Camera) Translate(delta vec2.V2)
- func (c *Camera) UnApply(x, y float64) (float64, float64)
- func (c *Camera) UnApplyPoint(v vec2.V2) vec2.V2
- type Clipper
- type DrawOptions
- type DrawRequester
- type Drawer
- type FaceLoaderF
- type FrameTexSrc
- type FrameUpdF
- type Layer
- type Line
- type MouseRect
- type OnMouser
- type OnMouserF
- type Polyline
- type Queue
- type RTransformer
- type Rect
- func (r Rect) AbsToRel(absPoint vec2.V2) (relPoint vec2.V2, ok bool)
- func (r Rect) ClipRect() Rect
- func (r Rect) Corners() (res [4]vec2.V2)
- func (r Rect) Empty() bool
- func (r Rect) OuterImageRect() (res image.Rectangle)
- func (r Rect) RelToAbs(relPoint vec2.V2) (absPoint vec2.V2)
- func (r Rect) TransformRect(rect Rect) Rect
- type RectDrawer
- type Scaler
- type Sector
- type SectorParams
- type Sprite
- type SpriteTrans
- type Tex
- type TexCache
- type TexLoaderF
- type TexSrcer
- type TextDrawer
- type TextSprite
- type TextSrc
- func (ts *TextSrc) AddText(text string)
- func (ts *TextSrc) AddTextExt(text string, face font.Face, align Align, clr color.Color)
- func (ts *TextSrc) GetSrcImage() *ebiten.Image
- func (ts *TextSrc) GetSrcRectUID() (srcRect *image.Rectangle, uid uint64)
- func (ts *TextSrc) Reset()
- func (ts *TextSrc) SetText(text string)
- func (ts *TextSrc) SetTextExt(text string, face font.Face, align Align, clr color.Color)
- type TransformerF
- type Transforms
- type TriDrawer
- type TriSrcer
- type Updater
- type VTransformer
Constants ¶
This section is empty.
Variables ¶
View Source
var IsJS = false
Functions ¶
func AddAfterLoopSub ¶
func AddAfterLoopSub(sub afterLooper) error
func DelAfterLoopSub ¶
func DelAfterLoopSub(sub afterLooper) error
func GetTempImage ¶
func PutPoolTex ¶
func PutPoolTex(tex Tex)
func PutTempImage ¶
func ResetFaceCache ¶
func ResetFaceCache()
func ScreenSize ¶
func ScreenSize() (w, h int)
func SetFaceLoader ¶
func SetFaceLoader(loader FaceLoaderF)
func SetTexLoader ¶
func SetTexLoader(f TexLoaderF)
func TexCacheReset ¶
func TexCacheReset()
func TransformUpVector ¶
func TransformUpVector(t VTransformer) vec2.V2
func TransformVector ¶
func TransformVector(t VTransformer, v vec2.V2) vec2.V2
Apply t to both ends of vector (0,0)-(v) and takes delta t(v)-t(0,0)
Types ¶
type Camera ¶
type Camera struct {
// contains filtered or unexported fields
}
func (*Camera) ClippedRect ¶
return true if we can skip drawing this rect, false if we should draw false negative is ok as we draw some off-screen, false positives are not accepted
func (*Camera) Local ¶
func (c *Camera) Local() RTransformer
func (*Camera) Mark ¶
func (c *Camera) Mark() RTransformer
func (*Camera) NoRot ¶
func (c *Camera) NoRot() RTransformer
func (*Camera) NoScale ¶
func (c *Camera) NoScale() RTransformer
func (*Camera) Phys ¶
func (c *Camera) Phys() RTransformer
func (*Camera) SetClipRect ¶
type DrawOptions ¶
type DrawOptions struct { Layer Layer // contains filtered or unexported fields }
func NewDrawOptions ¶
func NewDrawOptions(layer Layer) DrawOptions
func (DrawOptions) ColorAlpha ¶
func (do DrawOptions) ColorAlpha() (color.Color, float64)
func (DrawOptions) CompositeMode ¶
func (do DrawOptions) CompositeMode() ebiten.CompositeMode
func (*DrawOptions) SetAlpha ¶
func (do *DrawOptions) SetAlpha(alpha float64)
func (*DrawOptions) SetColor ¶
func (do *DrawOptions) SetColor(color color.Color)
func (*DrawOptions) SetCompositeMode ¶
func (do *DrawOptions) SetCompositeMode(mode ebiten.CompositeMode)
type DrawRequester ¶
type DrawRequester interface {
DrawReqs(Q *Queue)
}
type Drawer ¶
type Drawer struct { Src TexSrcer Transform RTransformer Clipper Clipper ChangeableTex bool DrawOptions // contains filtered or unexported fields }
type FaceLoaderF ¶
func FileFaceLoader ¶
func FileFaceLoader(pathStr string) FaceLoaderF
type FrameTexSrc ¶
type FrameTexSrc struct {
// contains filtered or unexported fields
}
func NewFrameTexSrc ¶
func NewFrameTexSrc(tex Tex, sizeX, sizeY, count int, updF FrameUpdF) (*FrameTexSrc, error)
func (*FrameTexSrc) Count ¶
func (f *FrameTexSrc) Count() int
func (*FrameTexSrc) FrameN ¶
func (f *FrameTexSrc) FrameN() int
func (*FrameTexSrc) GetSrcImage ¶
func (f *FrameTexSrc) GetSrcImage() *ebiten.Image
func (*FrameTexSrc) GetSrcRectUID ¶
func (f *FrameTexSrc) GetSrcRectUID() (srcRect *image.Rectangle, uid uint64)
func (*FrameTexSrc) SetFrameN ¶
func (f *FrameTexSrc) SetFrameN(n int)
func (*FrameTexSrc) Update ¶
func (f *FrameTexSrc) Update(dt float64)
type FrameUpdF ¶
type FrameUpdF func(src *FrameTexSrc, dt float64)
func AnimateFrameCycle ¶
func AnimateFrameOnce ¶
type Line ¶
type Line struct { CamTransform RTransformer DrawOptions From vec2.V2 To vec2.V2 Width float64 }
todo: change to triangles
func NewLine ¶
func NewLine(camTransform RTransformer, layer Layer) Line
func NewLineExt ¶
func NewLineExt(camTransform RTransformer, opts DrawOptions, from, to vec2.V2, width float64) Line
type MouseRect ¶
type MouseRect struct { MouseActive bool CatchRect image.Rectangle // contains filtered or unexported fields }
func NewClickRect ¶
func (*MouseRect) DeleteChild ¶
type Polyline ¶
type Polyline struct { CamTransform RTransformer DrawOptions Points []vec2.V2 Closed bool Width float64 Color color.Color }
func NewPolyline ¶
func NewPolyline(camTransform RTransformer, layer Layer) Polyline
func NewPolylineExt ¶
func NewPolylineExt(camTransform RTransformer, opts DrawOptions, points []vec2.V2, width float64, color color.Color) Polyline
type RTransformer ¶
type Rect ¶
type Rect struct { //position of pivot point in world coordinates Position vec2.V2 //size of rect, negative numbers are okay as that is a flipped axis Width float64 Height float64 //Rotation of rect in Degrees, counter clockwise Angle float64 // contains filtered or unexported fields }
var ZR Rect
func (Rect) OuterImageRect ¶
func (Rect) TransformRect ¶
type RectDrawer ¶
func NewRectDrawer ¶
func NewRectDrawer(r Rect, layer Layer, cam RTransformer) RectDrawer
func (RectDrawer) GetVerticesIndices ¶
func (rd RectDrawer) GetVerticesIndices() (v []ebiten.Vertex, i []uint16)
type Sector ¶
type Sector struct { SectorParams *TriDrawer // contains filtered or unexported fields }
func NewSector ¶
func NewSector(p SectorParams, layer Layer, vTransformer VTransformer) *Sector
type SectorParams ¶
type Sprite ¶
type Sprite struct { *SpriteTrans *Drawer // contains filtered or unexported fields }
func (*Sprite) GetSrcPointColor ¶
type SpriteTrans ¶
func (SpriteTrans) TransformRect ¶
func (s SpriteTrans) TransformRect(rect Rect) Rect
type Tex ¶
type Tex struct {
// contains filtered or unexported fields
}
func GetPoolTex ¶
func NewCircleTex ¶
func (Tex) GetSrcImage ¶
type TexCache ¶
type TexCache struct {
// contains filtered or unexported fields
}
func NewTexCache ¶
func NewTexCache(loader TexLoaderF) *TexCache
func (*TexCache) SetTexLoader ¶
func (tc *TexCache) SetTexLoader(f TexLoaderF)
type TexLoaderF ¶
func FileTexLoader ¶
func FileTexLoader(pathStr string) TexLoaderF
type TextDrawer ¶
type TextDrawer struct { Face font.Face Text string Layer Layer Position vec2.V2 Color color.Color }
func NewTextDrawer ¶
func NewTextDrawer(face font.Face, layer Layer) *TextDrawer
func (*TextDrawer) DrawReqs ¶
func (td *TextDrawer) DrawReqs(Q *Queue)
type TextSprite ¶
type TextSprite struct { *TextSrc *SpriteTrans *Drawer }
func NewTextSprite ¶
func NewTextSprite(interlineK float64, permanentTex bool, layer Layer, transforms ...RTransformer) *TextSprite
type TextSrc ¶
type TextSrc struct { //default values for new strings, already exist do not change DefFace font.Face DefColor color.Color DefAlign Align InterLineK float64 // contains filtered or unexported fields }
func NewTextSrc ¶
func NewTextSrcExt ¶
func (*TextSrc) AddTextExt ¶
func (*TextSrc) GetSrcImage ¶
func (*TextSrc) GetSrcRectUID ¶
type TransformerF ¶
func (TransformerF) ClipRect ¶
func (f TransformerF) ClipRect() image.Rectangle
func (TransformerF) TransformRect ¶
func (f TransformerF) TransformRect(rect Rect) Rect
type Transforms ¶
type Transforms []RTransformer
func (Transforms) TransformRect ¶
func (t Transforms) TransformRect(rect Rect) Rect
type TriDrawer ¶
type TriDrawer struct { Src TriSrcer Cam VTransformer Clipper Clipper ChangeableSrc bool DrawOptions // contains filtered or unexported fields }
func NewTriDrawer ¶
func NewTriDrawer(src TriSrcer, layer Layer, cam VTransformer) *TriDrawer
Source Files ¶
Click to show internal directories.
Click to hide internal directories.