跳到正文

Shader

使用有限数量的数值着色器参数绘制经过验证的 WGSL。

正在加载交互演示…

#导入

从 github.com/egoist/quickgui/go/ui 导入 ui。

import (
	"github.com/egoist/quickgui/go/ui"
)

#用法

func ShaderExample(source string, parameters func() []float64) *ui.Element {
	return ui.Shader().Value(source).ShaderParameters(parameters).
		Width(320).Height(180)
}

#API 参考

展开条目查看说明和完整签名。短横线表示声明中未记录默认值。

ui.Shader() *Element

Shader paints WGSL supplied through Value, with up to sixteen parameter floats.

ChildChild(child any) *Element—

Child appends content and returns this element. Content can be an element, native node, scalar, accessor, or node-returning construction callback.

Child(child any) *Element
查看源码
ChildrenChildren(children ...any) *Element—

Children appends multiple children in order without replacing existing content. It also accepts []any, []*Element, and []*native.Node slices as arguments. Read the retained child nodes through element.Node.Children.

Children(children ...any) *Element
查看源码
StyleStyle(style StyleBuilder) *Element—

Style merges a reusable style. Scalar accessors retain independent native bindings.

Style(style StyleBuilder) *Element
查看源码
OnClickOnClick(handler func()) *Element—

OnClick handles a click without an unused event parameter.

OnClick(handler func()) *Element
查看源码
RefRef(handler func(*native.Node)) *Element—

Ref exposes the native handle once at this point in the declaration chain.

Ref(handler func(*native.Node)) *Element
查看源码
PaddingPadding(value any) *Element—

Padding sets the corresponding style property.

Padding(value any) *Element
查看源码
BackgroundColorBackgroundColor(value any) *Element—

BackgroundColor sets the corresponding style property.

BackgroundColor(value any) *Element
查看源码
OnKeyDownOnKeyDown(value func(*native.Event)) *Element—

OnKeyDown configures the corresponding node property.

OnKeyDown(value func(*native.Event)) *Element
查看源码
OnFocusOnFocus(value func(*native.Event)) *Element—

OnFocus configures the corresponding node property.

OnFocus(value func(*native.Event)) *Element
查看源码
OnBlurOnBlur(value func(*native.Event)) *Element—

OnBlur configures the corresponding node property.

OnBlur(value func(*native.Event)) *Element
查看源码
DisabledDisabled(value any) *Element—

Disabled configures the corresponding node property.

Disabled(value any) *Element
查看源码
ValueValue(value any) *Element—

Value configures the corresponding node property.

Value(value any) *Element
查看源码
AriaLabelAriaLabel(value any) *Element—

AriaLabel configures the corresponding node property.

AriaLabel(value any) *Element
查看源码
ShaderParametersShaderParameters(value any) *Element—

ShaderParameters configures the corresponding node property.

ShaderParameters(value any) *Element
查看源码
TabIndexTabIndex(value any) *Element—

TabIndex configures the corresponding node property.

TabIndex(value any) *Element
查看源码