builtin

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BezierView

type BezierView struct {
	ViewImpl
	rendering.Appearance
	ControlPoint1, ControlPoint2 a.Vector3
}

func NewBezierView

func NewBezierView(cp1, cp2 a.Vector3) *BezierView

func (*BezierView) GetName

func (b *BezierView) GetName() string

func (*BezierView) OnDraw

func (b *BezierView) OnDraw(ctx engine.DrawingContext)

type BoundaryView

type BoundaryView struct {
	ViewImpl
}

func NewBoundaryView

func NewBoundaryView() *BoundaryView

func (*BoundaryView) GetName

func (r *BoundaryView) GetName() string

func (*BoundaryView) OnDraw

func (r *BoundaryView) OnDraw(ctx engine.DrawingContext)

type BuilderComponent

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

func (*BuilderComponent) GetName

func (c *BuilderComponent) GetName() string

func (*BuilderComponent) OnInit

func (c *BuilderComponent) OnInit(ctx engine.InitContext)

func (*BuilderComponent) OnStart

func (c *BuilderComponent) OnStart()

func (*BuilderComponent) OnStop

func (c *BuilderComponent) OnStop()

func (*BuilderComponent) OnUpdate

func (c *BuilderComponent) OnUpdate(ctx engine.UpdateContext)

type CircleBoundary

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

func NewCircleBoundary

func NewCircleBoundary() *CircleBoundary

func (*CircleBoundary) GetName

func (r *CircleBoundary) GetName() string

func (*CircleBoundary) IsPointInside

func (r *CircleBoundary) IsPointInside(_ a.Vector3) bool

func (*CircleBoundary) IsPointInside2D

func (r *CircleBoundary) IsPointInside2D(point a.Vector3) bool

func (*CircleBoundary) OnInit

func (r *CircleBoundary) OnInit(ctx engine.InitContext)

func (*CircleBoundary) OnStart

func (r *CircleBoundary) OnStart()

func (*CircleBoundary) OnStop

func (r *CircleBoundary) OnStop()

type ClickHandler

type ClickHandler func(vector3 a.IntVector3) bool

type ComponentBuilder

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

func NewComponentBuilder

func NewComponentBuilder(name string) *ComponentBuilder

func (*ComponentBuilder) Build

func (b *ComponentBuilder) Build() *BuilderComponent

func (*ComponentBuilder) OnStart

func (b *ComponentBuilder) OnStart(onStart func()) *ComponentBuilder

func (*ComponentBuilder) OnStop

func (b *ComponentBuilder) OnStop(onStop func()) *ComponentBuilder

func (*ComponentBuilder) OnUpdate

func (b *ComponentBuilder) OnUpdate(onUpdate func(ctx engine.UpdateContext)) *ComponentBuilder
type DropdownView struct {
	ViewImpl

	OnSelect OnSelectHandler
	// contains filtered or unexported fields
}

func NewDropdownView

func NewDropdownView(options []string) *DropdownView
func (d *DropdownView) GetName() string
func (d *DropdownView) GetSelectedItem() string
func (d *DropdownView) HandleClick()
func (d *DropdownView) OnDraw(ctx engine.DrawingContext)
func (d *DropdownView) OnStart()
func (d *DropdownView) OnStop()
func (d *DropdownView) SetItems(items []string)
func (d *DropdownView) SetSelectedItem(item string)

type GridLayout

type GridLayout struct {
	engine.ComponentImpl
	Rows       int `state:"rows"`
	Cols       int `state:"cols"`
	RowPadding int `state:"rowPadding"`
	ColPadding int `state:"colPadding"`
}

func NewGridLayout

func NewGridLayout() *GridLayout

func (*GridLayout) GetName

func (l *GridLayout) GetName() string

func (*GridLayout) LayoutChildren

func (l *GridLayout) LayoutChildren()

type ImageView

type ImageView struct {
	ViewImpl
	ResIndex int `state:"resIndex"`
}

Displays an image given it's resource index

func NewImageView

func NewImageView(index int) *ImageView

func (*ImageView) GetName

func (v *ImageView) GetName() string

func (*ImageView) OnDraw

func (v *ImageView) OnDraw(ctx engine.DrawingContext)

type InputField

type InputField struct {
	ViewImpl
	rendering.Appearance
	Padding        float32
	AllowMultiline bool
	// contains filtered or unexported fields
}

func NewInputField

func NewInputField() *InputField

func (*InputField) GetName

func (f *InputField) GetName() string

func (*InputField) OnDraw

func (f *InputField) OnDraw(ctx engine.DrawingContext)

func (*InputField) OnStart

func (f *InputField) OnStart()

type InputView

type InputView struct {
	TextView
	AllowMultiline bool
	// contains filtered or unexported fields
}

func NewInputView

func NewInputView() *InputView

func (*InputView) GetName

func (v *InputView) GetName() string

func (*InputView) OnStart

func (v *InputView) OnStart()

func (*InputView) OnStop

func (v *InputView) OnStop()

type MouseMover

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

func NewMouseMover

func NewMouseMover() *MouseMover

func (*MouseMover) GetName

func (m *MouseMover) GetName() string

func (*MouseMover) OnInit

func (m *MouseMover) OnInit(ctx engine.InitContext)

func (*MouseMover) OnMessage

func (m *MouseMover) OnMessage(msg engine.Message) bool

func (*MouseMover) OnStart

func (m *MouseMover) OnStart()

func (*MouseMover) OnStop

func (m *MouseMover) OnStop()

func (*MouseMover) OnUpdate

func (m *MouseMover) OnUpdate(_ engine.UpdateContext)

type OnClickListener

type OnClickListener struct {
	OnClick engine.EventHandler `state:"onClick"`
	// contains filtered or unexported fields
}

func NewOnClickListener

func NewOnClickListener(handler engine.EventHandler) *OnClickListener

func (*OnClickListener) GetName

func (l *OnClickListener) GetName() string

func (*OnClickListener) OnInit

func (l *OnClickListener) OnInit(ctx engine.InitContext)

func (*OnClickListener) OnMessage

func (l *OnClickListener) OnMessage(m engine.Message) bool

func (*OnClickListener) OnStart

func (l *OnClickListener) OnStart()

func (*OnClickListener) OnStop

func (l *OnClickListener) OnStop()

type OnSelectHandler

type OnSelectHandler func(item string)

type RectBoundary

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

func NewRectBoundary

func NewRectBoundary() *RectBoundary

func (*RectBoundary) GetName

func (r *RectBoundary) GetName() string

func (*RectBoundary) IsPointInside

func (r *RectBoundary) IsPointInside(point a.Vector3) bool

func (*RectBoundary) IsPointInside2D

func (r *RectBoundary) IsPointInside2D(point a.Vector3) bool

func (*RectBoundary) OnInit

func (r *RectBoundary) OnInit(ctx engine.InitContext)

func (*RectBoundary) OnStart

func (r *RectBoundary) OnStart()

func (*RectBoundary) OnStop

func (r *RectBoundary) OnStop()

type ShapeView

type ShapeView struct {
	ViewImpl
	FillColor    a.Color `state:"fillColor"`
	StrokeColor  a.Color `state:"strokeColor"`
	StrokeWeight byte    `state:"strokeWeight"`
	CornerRadius byte    `state:"cornerRadius"`
	// contains filtered or unexported fields
}

Displays a basic shape: rectangle, ellipse, triangle, line, point.

func NewShapeView

func NewShapeView(pType byte) *ShapeView

func (*ShapeView) GetName

func (c *ShapeView) GetName() string

func (*ShapeView) OnDraw

func (c *ShapeView) OnDraw(ctx engine.DrawingContext)

type TextView

type TextView struct {
	ViewImpl
	TextColor  a.Color `state:"textColor"`
	Font       string  `state:"font"`
	FontSize   byte    `state:"fontSize"`
	FontWeight byte    `state:"fontWeight"`
	Text       string  `state:"text"`
}

Component for displaying text

func NewTextView

func NewTextView(text string) *TextView

func (*TextView) GetName

func (t *TextView) GetName() string

func (*TextView) GetText

func (t *TextView) GetText() string

func (*TextView) OnDraw

func (t *TextView) OnDraw(ctx engine.DrawingContext)

func (*TextView) SetText

func (t *TextView) SetText(text string)

type TriangleBoundary

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

func NewTriangleBoundary

func NewTriangleBoundary() *TriangleBoundary

func (*TriangleBoundary) GetName

func (r *TriangleBoundary) GetName() string

func (*TriangleBoundary) IsPointInside

func (r *TriangleBoundary) IsPointInside(_ a.Vector3) bool

func (*TriangleBoundary) IsPointInside2D

func (r *TriangleBoundary) IsPointInside2D(point a.Vector3) bool

func (*TriangleBoundary) OnInit

func (r *TriangleBoundary) OnInit(ctx engine.InitContext)

func (*TriangleBoundary) OnStart

func (r *TriangleBoundary) OnStart()

func (*TriangleBoundary) OnStop

func (r *TriangleBoundary) OnStop()

type ViewImpl

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

func (*ViewImpl) ForceRedraw

func (v *ViewImpl) ForceRedraw()

func (*ViewImpl) GetName

func (v *ViewImpl) GetName() string

func (*ViewImpl) OnDraw

func (v *ViewImpl) OnDraw(_ engine.DrawingContext)

func (*ViewImpl) OnInit

func (v *ViewImpl) OnInit(ctx engine.InitContext)

func (*ViewImpl) OnMessage

func (v *ViewImpl) OnMessage(message engine.Message) bool

func (*ViewImpl) OnStart

func (v *ViewImpl) OnStart()

func (*ViewImpl) OnStop

func (v *ViewImpl) OnStop()

func (*ViewImpl) ShouldRedraw

func (v *ViewImpl) ShouldRedraw() bool

Jump to

Keyboard shortcuts

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