Files
fs2open.github.com/code/hud/hudscripting.h
asarium 1662a3c317 Add new HUD gauge type for scripted gauges
The new gauge can be accessed by the scripting API with which a function
can be set which will be called when this gauge is rendered. This can be
used for exposing the HUD gauge positioning and RTT options to the
scripting API without a lot of work needed for the script writer.

There is currently only one rendering function implemented since this is
only a proof of concept.
2019-03-17 09:27:58 +01:00

19 lines
422 B
C++

#pragma once
#include "globalincs/pstypes.h"
#include "hud/hud.h"
#include "scripting/lua/LuaFunction.h"
class HudGaugeScripting: public HudGauge {
luacpp::LuaFunction _renderFunction;
public:
HudGaugeScripting();
void render(float frametime) override;
void initName(SCP_string name);
const luacpp::LuaFunction& getRenderFunction() const;
void setRenderFunction(const luacpp::LuaFunction& renderFunction);
};