CVguiJavascriptContext

From Empires Wiki
Revision as of 19:19, 17 April 2017 by Thexa4 (talk | contribs)
Jump to navigation Jump to search

This VGUI element allows you to define its layout using res files and its behavior using javascript.

Attributes

This element inherits all attributes from EditablePanel.

  • src The javascript file to load

Javascript

You can use javascript to add behavior to your element. By default the standard library and vgui library are available for you to use.

Your javascript code is only run once during startup. During this you can register to bindings which call your code if a value you're interested in changes. During that callback you can update your element.