Toolkit Class

From Heroes of Hammerwatch wiki
Revision as of 12:00, 5 July 2019 by Miss (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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 Save(SValueBuilder@ builder)
  • void Load(SValue@ data)
  • void Update(int dt)
  • void Render(SpriteBatch& sb, int idt)
  • void RenderMenu()
  • void ResourcesToReload(array<string>@ res)
  • void OnResourcesReloaded()