Documentation ¶
Index ¶
- Constants
- type ARenderer
- func (r *ARenderer) AddLayer()
- func (r *ARenderer) AddPrimitive() int
- func (r *ARenderer) Clear()
- func (r *ARenderer) GetLayer(index int) *Layer
- func (r *ARenderer) GetRenderingPerformer() func()
- func (r *ARenderer) PerformRendering()
- func (r *ARenderer) Prepare()
- func (r *ARenderer) RegisterPrimitiveRendererDelegate(primitiveKind byte, delegate PrimitiveRendererDelegate)
- func (r *ARenderer) RemoveLayer(index int)
- func (r *ARenderer) RemovePrimitive(id int)
- func (r *ARenderer) SetManagementMode(mode ManagementMode)
- func (r *ARenderer) SetPreparedCallback(f func())
- func (r *ARenderer) SetPrimitive(id int, primitive IPrimitive, shouldRerender bool)
- func (r *ARenderer) SetPrimitiveLayer(primitiveId, layerIndex int)
- func (r *ARenderer) Stop()
- type Appearance
- type BezierPrimitive
- type GeometryPrimitive
- type IPrimitive
- type ImagePrimitive
- type Layer
- type ManagementMode
- type PrimitiveContainer
- type PrimitiveRendererDelegate
- type PrimitiveRenderingContext
- type RendererDelegate
- type TextAppearance
- type TextPrimitive
- type Transform
Constants ¶
View Source
const ( PrimitiveEmpty byte = iota PrimitivePoint PrimitiveLine PrimitiveRectangle PrimitiveEllipse PrimitiveTriangle PrimitiveText PrimitiveImage PrimitiveBezier PrimitiveGlyph )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ARenderer ¶ added in v0.2.0
type ARenderer struct {
// contains filtered or unexported fields
}
func NewARenderer ¶ added in v0.2.0
func NewARenderer(delegate RendererDelegate, renderDispatcher dispatch.WorkDispatcher) *ARenderer
func (*ARenderer) AddPrimitive ¶ added in v0.2.0
Any thread, update goroutine
func (*ARenderer) GetRenderingPerformer ¶ added in v0.2.0
func (r *ARenderer) GetRenderingPerformer() func()
func (*ARenderer) PerformRendering ¶ added in v0.2.0
func (r *ARenderer) PerformRendering()
Main or rendering thread
func (*ARenderer) Prepare ¶ added in v0.2.0
func (r *ARenderer) Prepare()
PC - main, android - rendering thread
func (*ARenderer) RegisterPrimitiveRendererDelegate ¶ added in v0.2.0
func (r *ARenderer) RegisterPrimitiveRendererDelegate(primitiveKind byte, delegate PrimitiveRendererDelegate)
func (*ARenderer) RemoveLayer ¶ added in v0.2.0
func (*ARenderer) RemovePrimitive ¶ added in v0.2.0
Any thread, update goroutine
func (*ARenderer) SetManagementMode ¶ added in v0.2.0
func (r *ARenderer) SetManagementMode(mode ManagementMode)
func (*ARenderer) SetPreparedCallback ¶ added in v0.2.1
func (r *ARenderer) SetPreparedCallback(f func())
func (*ARenderer) SetPrimitive ¶ added in v0.2.0
func (r *ARenderer) SetPrimitive(id int, primitive IPrimitive, shouldRerender bool)
Any thread, update goroutine
func (*ARenderer) SetPrimitiveLayer ¶ added in v0.2.0
type Appearance ¶
type Appearance struct { FillColor a.Color StrokeColor a.Color StrokeWeight byte CornerRadius byte }
func DefaultAppearance ¶
func DefaultAppearance() Appearance
func (Appearance) ToMap ¶
func (ap Appearance) ToMap() map[string]interface{}
type BezierPrimitive ¶
type BezierPrimitive struct { Transform Transform Appearance Appearance ControlPoint1 a.IntVector3 ControlPoint2 a.IntVector3 }
func NewBezierPrimitive ¶
func NewBezierPrimitive(cp1, cp2 a.IntVector3) *BezierPrimitive
func (*BezierPrimitive) GetTransform ¶
func (b *BezierPrimitive) GetTransform() Transform
func (*BezierPrimitive) GetType ¶
func (b *BezierPrimitive) GetType() byte
func (*BezierPrimitive) SetTransform ¶ added in v0.2.0
func (b *BezierPrimitive) SetTransform(t Transform)
type GeometryPrimitive ¶
type GeometryPrimitive struct { Transform Transform Appearance Appearance // contains filtered or unexported fields }
func NewGeometryPrimitive ¶
func NewGeometryPrimitive(pType byte) *GeometryPrimitive
func (*GeometryPrimitive) GetTransform ¶
func (p *GeometryPrimitive) GetTransform() Transform
func (*GeometryPrimitive) GetType ¶
func (p *GeometryPrimitive) GetType() byte
func (*GeometryPrimitive) SetTransform ¶ added in v0.2.0
func (p *GeometryPrimitive) SetTransform(t Transform)
type IPrimitive ¶
type ImagePrimitive ¶
func NewImagePrimitive ¶
func NewImagePrimitive(url string) *ImagePrimitive
func (*ImagePrimitive) GetTransform ¶
func (p *ImagePrimitive) GetTransform() Transform
func (*ImagePrimitive) GetType ¶
func (p *ImagePrimitive) GetType() byte
func (*ImagePrimitive) SetTransform ¶ added in v0.2.0
func (p *ImagePrimitive) SetTransform(t Transform)
type Layer ¶ added in v0.2.0
type Layer struct {
// contains filtered or unexported fields
}
func (*Layer) GetTranslation ¶ added in v0.2.0
func (l *Layer) GetTranslation() a.IntVector3
func (*Layer) SetTranslation ¶ added in v0.2.0
func (l *Layer) SetTranslation(t a.IntVector3)
type ManagementMode ¶ added in v0.2.0
type ManagementMode byte
const ( EngineManaged ManagementMode = iota FrontendManaged )
type PrimitiveContainer ¶ added in v0.2.0
type PrimitiveContainer struct {
// contains filtered or unexported fields
}
type PrimitiveRendererDelegate ¶ added in v0.2.0
type PrimitiveRendererDelegate interface { OnStart() OnSetPrimitive(ctx *PrimitiveRenderingContext) OnRender(ctx *PrimitiveRenderingContext) OnRemovePrimitive(ctx *PrimitiveRenderingContext) OnStop() }
type PrimitiveRenderingContext ¶ added in v0.2.0
type PrimitiveRenderingContext struct { Renderer *ARenderer Primitive IPrimitive PrimitiveKind byte PrimitiveId int State interface{} Redraw bool }
type RendererDelegate ¶ added in v0.2.0
type RendererDelegate interface { OnPrepare() OnPerformRenderingStart() OnPerformRenderingEnd() OnClear() OnStop() }
type TextAppearance ¶
func DefaultTextAppearance ¶
func DefaultTextAppearance() TextAppearance
func (TextAppearance) ToMap ¶
func (a TextAppearance) ToMap() map[string]interface{}
type TextPrimitive ¶
type TextPrimitive struct { Transform Transform Appearance Appearance TextAppearance TextAppearance Text string HTextAlign a.TextAlign VTextAlign a.TextAlign }
func NewTextPrimitive ¶
func NewTextPrimitive(text string) *TextPrimitive
func (*TextPrimitive) GetTransform ¶
func (p *TextPrimitive) GetTransform() Transform
func (*TextPrimitive) GetType ¶
func (p *TextPrimitive) GetType() byte
func (*TextPrimitive) SetTransform ¶ added in v0.2.0
func (p *TextPrimitive) SetTransform(t Transform)
type Transform ¶
type Transform struct { Position a.IntVector3 Rotation a.IntVector3 Size a.IntVector3 }
func NewTransform ¶
func NewTransform() Transform
func (Transform) GetRect ¶ added in v0.1.9
func (t Transform) GetRect() *common.RectBoundary
Click to show internal directories.
Click to hide internal directories.