vthree

package
v0.0.0-...-5235613 Latest Latest
Warning

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

Go to latest
Published: May 14, 2022 License: BSD-3-Clause Imports: 5 Imported by: 1

Documentation

Rendered for js/wasm

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Basic

type Basic struct {
	vecty.Core

	// Wait period is the time renderer sleeps
	// between unrendered frames when Animate returns false.
	// Default WaitPeriod on zero value is 200ms.
	WaitPeriod time.Duration `vecty:"prop"`
	// Markup should be constant during rendering.
	Markup []vecty.MarkupOrChild `vecty:"prop"`
	// Init is called upon mounting. It should not be nil.
	Init func(three.WebGLRenderer) `vecty:"prop"`
	// Animate should return true if user wants to render
	// the current scene. If Animate is nil then scene is rendered
	// as Init left it.
	Animate func(three.WebGLRenderer) bool `vecty:"prop"`
	// Shutdown is called on dismounting the vecty component.
	Shutdown func(three.WebGLRenderer) `vecty:"prop"`
	// contains filtered or unexported fields
}

Basic is a Vecty Component implementation for use with the three package. Basic works by calling Animate callback between rendered frames or if a static scene is to be displayed, by a nil Animate function and a initializer Init function. Init cannot be nil.

All `vecty:"prop"` arguments should remain constant during rendering until Basic is unmounted.

func (*Basic) Mount

func (v *Basic) Mount()

Mount is called automatically by Vecty.

func (*Basic) Render

func (b *Basic) Render() vecty.ComponentOrHTML

Render implements vecty.MarkupOrChild interface.

func (*Basic) SkipRender

func (b *Basic) SkipRender(vecty.Component) bool

func (*Basic) Unmount

func (v *Basic) Unmount()

Unmount will tear down the renderer. It is called automatically by vecty when Basic's node parent is removed from the DOM.

Jump to

Keyboard shortcuts

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