feat: added HUD class
This commit is contained in:
parent
a4e158930d
commit
fbecc9f684
23
modules/wave_survival/heads_up_display.cpp
Normal file
23
modules/wave_survival/heads_up_display.cpp
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
#include "heads_up_display.h"
|
||||||
|
|
||||||
|
void HeadsUpDisplay::_bind_methods() {
|
||||||
|
}
|
||||||
|
|
||||||
|
void HeadsUpDisplay::enter_tree() {
|
||||||
|
}
|
||||||
|
|
||||||
|
void HeadsUpDisplay::_notification(int what) {
|
||||||
|
if (Engine::get_singleton()->is_editor_hint()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
switch (what) {
|
||||||
|
default:
|
||||||
|
return;
|
||||||
|
case NOTIFICATION_ENTER_TREE:
|
||||||
|
enter_tree();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void HeadsUpDisplay::set_reticle_visibility(bool visible) {
|
||||||
|
}
|
21
modules/wave_survival/heads_up_display.h
Normal file
21
modules/wave_survival/heads_up_display.h
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
#ifndef HEADS_UP_DISPLAY_H
|
||||||
|
#define HEADS_UP_DISPLAY_H
|
||||||
|
|
||||||
|
#include "scene/gui/control.h"
|
||||||
|
|
||||||
|
class HeadsUpDisplay : public Control {
|
||||||
|
GDCLASS(HeadsUpDisplay, Control);
|
||||||
|
static void _bind_methods();
|
||||||
|
void on_child_entered(Node *node);
|
||||||
|
void enter_tree();
|
||||||
|
protected:
|
||||||
|
void _notification(int what);
|
||||||
|
|
||||||
|
public:
|
||||||
|
void set_reticle_visibility(bool visible);
|
||||||
|
|
||||||
|
private:
|
||||||
|
Control *reticle{ nullptr };
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // !HEADS_UP_DISPLAY_H
|
Loading…
Reference in a new issue