You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
622 B
42 lines
622 B
#include "olcPixelGameEngine.h"
|
|
|
|
using namespace olc;
|
|
|
|
class Example : public olc::PixelGameEngine
|
|
{
|
|
public:
|
|
Example()
|
|
{
|
|
sAppName = "Example";
|
|
}
|
|
|
|
bool OnUserCreate() override
|
|
{
|
|
return true;
|
|
}
|
|
|
|
void OnTextEntryComplete(const std::string& sText)override{
|
|
std::cout<<"Called."<<std::endl;
|
|
};
|
|
|
|
bool OnUserUpdate(float fElapsedTime) override
|
|
{
|
|
Clear(BLACK);
|
|
if(GetKey(F1).bPressed){
|
|
TextEntryEnable(true);
|
|
}
|
|
if(IsTextEntryEnabled()){
|
|
DrawString({0,0},TextEntryGetString());
|
|
}
|
|
return true;
|
|
}
|
|
};
|
|
|
|
int main()
|
|
{
|
|
Example demo;
|
|
if (demo.Construct(640, 480, 4, 4))
|
|
demo.Start();
|
|
|
|
return 0;
|
|
}
|
|
|