Back to godoc.org

Package draw

v0.0.0-...-32a2d26
Latest Go to latest

The latest major version is .

Published: Dec 4, 2018 | License: Apache-2.0 | Module: github.com/shnifer/magellan

Index

Constants

const (
	Face_cap   = "caption"
	Face_stats = "stats"
	Face_list  = "list"
	Face_mono  = "mono"
)
const (
	Mark_size = 50
)

Variables

var Fonts map[string]font.Face

func GetAtlasRoundTex

func GetAtlasRoundTex(name string) graph.Tex

func GetAtlasTex

func GetAtlasTex(name string) graph.Tex

return tex. if can't find return default tex panic on error

func GetSlidingAtlasTex

func GetSlidingAtlasTex(name string) graph.Tex

func InitFonts

func InitFonts()

func InitTexAtlas

func InitTexAtlas()

func LowQualityCosmoPoint

func LowQualityCosmoPoint(v bool)

must be set once before creating CosmoPoints

func MarkAlpha

func MarkAlpha(size float64, cam *graph.Camera) (alphaMark, alphaSprite float64)

func MarkScaleLevel

func MarkScaleLevel(level int) float64

func NewAtlasFrame9HUD

func NewAtlasFrame9HUD(atlasName string, w, h int, layer int) *graph.Frame9HUD

func NewAtlasRoundSprite

func NewAtlasRoundSprite(atlasName string, params graph.CamParams) *graph.Sprite

func NewAtlasSprite

func NewAtlasSprite(atlasName string, params graph.CamParams) *graph.Sprite

func NewAtlasSpriteHUD

func NewAtlasSpriteHUD(atlasName string) *graph.Sprite

func SignatureAttrF

func SignatureAttrF(sig commons.Signature, fstr string, koefName string) (res flow.AttrF)

func SignatureVelSpawn

func SignatureVelSpawn(sig commons.Signature) (VelocityF func(pos v2.V2) v2.V2, SpawnPos func() (pos v2.V2))

type AnnounceText

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

func NewAnnounceText

func NewAnnounceText(pos v2.V2, pivot v2.V2, face font.Face, layer int) *AnnounceText

func (*AnnounceText) AddMsg

func (at *AnnounceText) AddMsg(msg string, clr color.Color, dur float64)

func (*AnnounceText) Req

func (at *AnnounceText) Req(Q *graph.DrawQueue)

func (*AnnounceText) Update

func (at *AnnounceText) Update(dt float64)

type ButtonOpts

type ButtonOpts struct {
	Tex          graph.Tex
	Clr          color.Color
	HighlightClr color.Color

	Caption string
	Face    font.Face
	CapClr  color.Color

	//will be returned on events
	Tags string
}

type ButtonsPanel

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

func NewButtonsPanel

func NewButtonsPanel(opts ButtonsPanelOpts) *ButtonsPanel

func (*ButtonsPanel) AddButton

func (bp *ButtonsPanel) AddButton(opts ButtonOpts)

func (*ButtonsPanel) ClearButtons

func (bp *ButtonsPanel) ClearButtons()

remove old buttons and create new

func (*ButtonsPanel) Disable

func (bp *ButtonsPanel) Disable()

func (*ButtonsPanel) Enable

func (bp *ButtonsPanel) Enable()

func (*ButtonsPanel) Highlight

func (bp *ButtonsPanel) Highlight(tagPrefix string)

func (*ButtonsPanel) ProcMouse

func (bp *ButtonsPanel) ProcMouse(x, y int) (tags string, ok bool)

func (*ButtonsPanel) Req

func (bp *ButtonsPanel) Req(Q *graph.DrawQueue)

func (*ButtonsPanel) SetActive

func (bp *ButtonsPanel) SetActive(active bool)

func (*ButtonsPanel) Update

func (bp *ButtonsPanel) Update(dt float64)

type ButtonsPanelOpts

type ButtonsPanelOpts struct {
	PivotP v2.V2
	PivotV v2.V2

	ButtonLayer  int
	CaptionLayer int
	ButtonSize   v2.V2

	ButtonSpace float64
	BorderSpace float64

	SlideV v2.V2
	SlideT float64
}

type CosmoPoint

type CosmoPoint struct {
	MarkGlowSprite *graph.Sprite
	MarkSprite     *graph.CycledSprite

	//static sprite for lowQ
	SimpleSprite *graph.Sprite

	//for not-so-lowQ
	//we use sliding or cycling depends on Type
	SlidingSphere *SlidingSphere
	CycledSprite  *graph.CycledSprite

	//warpRanges
	WarpInner *graph.Sprite
	WarpOuter *graph.Sprite
	WarpGreen *graph.WavedCircle
	WarpSize  float64

	ID   string
	Pos  v2.V2
	Size float64
	Type string

	EmiDist *graph.CircleLine
	// contains filtered or unexported fields
}

func NewCosmoPoint

func NewCosmoPoint(pd *GalaxyPoint, params graph.CamParams) *CosmoPoint

func (*CosmoPoint) GetCaption

func (cp *CosmoPoint) GetCaption() string

func (*CosmoPoint) GetCaptionTop

func (cp *CosmoPoint) GetCaptionTop() string

func (*CosmoPoint) Req

func (cp *CosmoPoint) Req(Q *graph.DrawQueue)

func (*CosmoPoint) SetCaption

func (cp *CosmoPoint) SetCaption(caption string, clr color.Color)

func (*CosmoPoint) SetCaptionTop

func (cp *CosmoPoint) SetCaptionTop(caption string, clr color.Color)

func (*CosmoPoint) Update

func (cp *CosmoPoint) Update(dt float64)

type GravityPredictorSource

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

func NewGravityPredictorSource

func NewGravityPredictorSource(galaxy *Galaxy, gravDt float64, garantLen int) *GravityPredictorSource

type OtherShip

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

func NewOtherShip

func NewOtherShip(params graph.CamParams, caption string, elastic float64) *OtherShip

func (*OtherShip) Req

func (s *OtherShip) Req(Q *graph.DrawQueue)

func (*OtherShip) SetRB

func (s *OtherShip) SetRB(rb commons.RBData)

func (*OtherShip) Update

func (s *OtherShip) Update(dt float64)

type SignaturePack

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

func NewSignaturePack

func NewSignaturePack(camParams graph.CamParams, baseLayer int) *SignaturePack

func (*SignaturePack) ActiveSignatures

func (sp *SignaturePack) ActiveSignatures(sigs []Signature)

func (*SignaturePack) Req

func (sp *SignaturePack) Req(Q *graph.DrawQueue)

func (*SignaturePack) Update

func (sp *SignaturePack) Update(dt float64)

type SlidingSphere

type SlidingSphere struct {
	*graph.Sprite
	// contains filtered or unexported fields
}

func NewAtlasSlidingSphere

func NewAtlasSlidingSphere(atlasName string, params graph.CamParams, periodS float64) *SlidingSphere

func (*SlidingSphere) AddSlide

func (ss *SlidingSphere) AddSlide(deltaSlide float64)

func (*SlidingSphere) DrawF

func (ss *SlidingSphere) DrawF() (graph.DrawF, string)

func (*SlidingSphere) SetSlide

func (ss *SlidingSphere) SetSlide(slide float64)

func (*SlidingSphere) Update

func (ss *SlidingSphere) Update(dt float64)

type SonarHUD

type SonarHUD struct {
	*SignaturePack
	// contains filtered or unexported fields
}

func NewSonarHUD

func NewSonarHUD(pos v2.V2, size float64, params graph.CamParams, layer int) *SonarHUD

func (*SonarHUD) Req

func (s *SonarHUD) Req(Q *graph.DrawQueue)

type TexAtlas

type TexAtlas map[string]TexAtlasRec

type TexAtlasRec

type TexAtlasRec struct {
	FileName string
	Sx, Sy   int
	Count    int
	Smooth   bool
}

type TextInput

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

func NewTextInput

func NewTextInput(sprite *graph.Sprite, face font.Face, clr color.Color, layer int, onDone func(string, bool)) *TextInput

func (*TextInput) GetText

func (ti *TextInput) GetText() string

func (*TextInput) Req

func (ti *TextInput) Req(Q *graph.DrawQueue)

func (*TextInput) SetText

func (ti *TextInput) SetText(text string)

func (*TextInput) Update

func (ti *TextInput) Update(dt float64)

type TrackPredictor

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

func NewTrackPredictor

func NewTrackPredictor(opts TrackPredictorOpts) *TrackPredictor

func (*TrackPredictor) Req

func (tp *TrackPredictor) Req(Q *graph.DrawQueue)

func (*TrackPredictor) SetAccelSessionTimeShipPos

func (tp *TrackPredictor) SetAccelSessionTimeShipPos(accel v2.V2, sessionTime float64, ship RBData)

type TrackPredictorOpts

type TrackPredictorOpts struct {
	Cam    *graph.Camera
	Sprite *graph.Sprite
	Clr    color.Color
	Layer  int

	GPS *GravityPredictorSource

	//in S
	UpdT     float64
	NumInSec int
	GravEach int
	TrackLen int
	DrawMaxP int
}

type WarpPredictor

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

func NewWarpPredictor

func NewWarpPredictor(opts WarpPredictorOpts) *WarpPredictor

func (*WarpPredictor) Req

func (wp *WarpPredictor) Req(Q *graph.DrawQueue)

func (*WarpPredictor) SetPosDistDir

func (wp *WarpPredictor) SetPosDistDir(shipPos v2.V2, distortion, dir float64)

type WarpPredictorOpts

type WarpPredictorOpts struct {
	Cam    *graph.Camera
	Sprite *graph.Sprite
	Clr    color.Color
	Layer  int

	Galaxy *Galaxy

	//in S
	UpdT     float64
	NumInSec int
	TrackLen int

	DrawMaxP int

	PowN float64
}

type WayPoint

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

func NewWayPoint

func NewWayPoint(cam *graph.Camera, clr color.Color, showPoint bool) *WayPoint

func (*WayPoint) Req

func (wp *WayPoint) Req(Q *graph.DrawQueue)

func (*WayPoint) SetActive

func (wp *WayPoint) SetActive(active bool)

func (*WayPoint) SetShipPoint

func (wp *WayPoint) SetShipPoint(ship, point v2.V2)

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier