Difference between revisions of "Toolkit Class"
From Heroes of Hammerwatch wiki
(Created page with "Toolkit classes are defined using the <code>[Toolkit]</code> metadata: [Toolkit] class UnitViewer : TestSceneTool ==Methods called from the engine== The engine calls the...") |
|||
| Line 3: | Line 3: | ||
[Toolkit] | [Toolkit] | ||
class UnitViewer : TestSceneTool | class UnitViewer : TestSceneTool | ||
| + | |||
| + | Objects are constructed using this constructor: | ||
| + | |||
| + | ClassName(ToolkitScript@ script) | ||
==Methods called from the engine== | ==Methods called from the engine== | ||
Revision as of 13:36, 19 June 2019
Toolkit classes are defined using the [Toolkit] metadata:
[Toolkit] class UnitViewer : TestSceneTool
Objects are constructed using this constructor:
ClassName(ToolkitScript@ script)
Methods called from the engine
The engine calls the following functions, if they exist:
void OnShow()void OnHide()void OnKeyPress(int scancode)void OnKeyDown(int scancode)void OnKeyUp(int scancode)void OnMouseDown(vec2 pos, int button)void OnMouseUp(vec2 pos, int button)void OnMouseMove(vec2 pos)void OnMouseWheel(vec2 delta)void Initialize()void Update(int dt)void Render(SpriteBatch& sb, int idt)void RenderMenu()void ResourcesToReload(array<string>@ res)void OnResourcesReloaded()