Documentation ¶
Index ¶
- Variables
- func ExportRegistered()
- func Load(path string) (a NFObjects.AssetProperties, err error)
- func NewAndRegister(widgetType string, requiredArgs, optionalArgs *NFData.NFInterfaceMap, ...)
- type Widget
- func (w *Widget) AddChild(new NFObjects.NFRendered)
- func (w *Widget) AddFunction(new NFObjects.NFObject)
- func (w *Widget) CheckArgs() error
- func (w *Widget) DeleteByID(ID uuid.UUID, search bool) error
- func (w *Widget) DeleteChild(childID uuid.UUID, search bool) error
- func (w *Widget) DeleteFunction(functionID uuid.UUID, search bool) error
- func (w *Widget) Export() error
- func (w *Widget) FetchChildren(children map[uuid.UUID][]NFObjects.NFObject) int
- func (w *Widget) FetchChildrenAndFunctions(childrenAndFunctions map[uuid.UUID][]NFObjects.NFObject) int
- func (w *Widget) FetchFunctions(functions map[uuid.UUID][]NFObjects.NFObject) int
- func (w *Widget) FetchIDs() []uuid.UUID
- func (w *Widget) GetArgs() *NFData.NFInterfaceMap
- func (w *Widget) GetByID(ID uuid.UUID) NFObjects.NFObject
- func (w *Widget) GetChildByID(childID uuid.UUID) NFObjects.NFObject
- func (w *Widget) GetFunctionByID(functionID uuid.UUID) NFObjects.NFObject
- func (w *Widget) GetFunctions() []NFObjects.NFObject
- func (w *Widget) GetID() uuid.UUID
- func (w *Widget) GetName() string
- func (w *Widget) GetType() string
- func (w *Widget) MakeId()
- func (w *Widget) Parse(window fyne.Window) (fyne.CanvasObject, error)
- func (w *Widget) Register(handler widgetHandler)
- func (w *Widget) RunAction(action string, window fyne.Window, newValues *NFData.NFInterfaceMap) (*NFData.NFInterfaceMap, error)
- func (w *Widget) RunAllActions(action string, window fyne.Window, newValues *NFData.NFInterfaceMap) (int, []*NFData.NFInterfaceMap, error)
- func (w *Widget) SetArgs(args *NFData.NFInterfaceMap)
- func (w *Widget) SetName(newName string)
- func (w *Widget) SetType(t string)
- func (w *Widget) Validate() error
Constants ¶
This section is empty.
Variables ¶
View Source
var ExportPath = "exports/widgets"
ExportPath is the path where the widget will be exported
View Source
var Widgets = map[string]widgetWithHandler{}
Widgets is a map of all the widgets that are registered and can be used by the engine
Functions ¶
func ExportRegistered ¶
func ExportRegistered()
ExportRegistered exports all registered widgets to json files
func NewAndRegister ¶
func NewAndRegister(widgetType string, requiredArgs, optionalArgs *NFData.NFInterfaceMap, handler widgetHandler)
NewAndRegister creates a new widget with the given type and registers it
Types ¶
type Widget ¶
type Widget struct { // Name is the name of the widget for display in the editor Name string `json:"Name"` // ID is the unique ID of the widget for later reference in editing UUID uuid.UUID `json:"UUID"` // Type is the type of widget that is used to parse the widget this should be Globally Unique, so when making //custom ones prefix it with your package name like "MyPackage.MyWidget" Type string `json:"Type"` // Children is a list of widgets that are children of this widget Children []*Widget `json:"Children"` // Functions is a list of functions that are children of this widget for action based execution Functions []*NFFunction.Function `json:"Functions"` // SupportedActions is a list of actions that the widget supports for action based execution SupportedActions []string `json:"-"` // RequiredArgs is a list of arguments that are required for the widget to run RequiredArgs *NFData.NFInterfaceMap `json:"-"` // OptionalArgs is a list of arguments that are optional for the widget to run OptionalArgs *NFData.NFInterfaceMap `json:"-"` // Args is a list of arguments that are passed to the widget through the scene Args *NFData.NFInterfaceMap `json:"Args"` }
Widget is the struct that holds all the information about a widget
func GetWidgetInfo ¶
GetWidgetInfo gets the info of a widget
func New ¶
func New(widgetType string, children []*Widget, args *NFData.NFInterfaceMap) *Widget
New creates a new widget with the given type
func NewChildren ¶
func (*Widget) AddChild ¶
func (w *Widget) AddChild(new NFObjects.NFRendered)
func (*Widget) AddFunction ¶
func (*Widget) DeleteFunction ¶
func (*Widget) Export ¶
Export is a function that is used to export the widget to a json file These files are used in the main editor to determine inputs needed to call a widget in a scene
func (*Widget) FetchChildren ¶
func (*Widget) FetchChildrenAndFunctions ¶
func (*Widget) FetchFunctions ¶
func (*Widget) GetArgs ¶
func (w *Widget) GetArgs() *NFData.NFInterfaceMap
func (*Widget) GetFunctionByID ¶
func (*Widget) GetFunctions ¶
func (*Widget) Register ¶
func (w *Widget) Register(handler widgetHandler)
Register adds a custom widget to the customWidgets map
func (*Widget) RunAction ¶
func (w *Widget) RunAction(action string, window fyne.Window, newValues *NFData.NFInterfaceMap) (*NFData.NFInterfaceMap, error)
func (*Widget) RunAllActions ¶
func (w *Widget) RunAllActions(action string, window fyne.Window, newValues *NFData.NFInterfaceMap) (int, []*NFData.NFInterfaceMap, error)
func (*Widget) SetArgs ¶
func (w *Widget) SetArgs(args *NFData.NFInterfaceMap)
Click to show internal directories.
Click to hide internal directories.