PDA

View Full Version : Repetitive Typed Character on the InputTextRenderComponent



yohanip
03-19-2012, 10:42 AM
Hi :)
tried the following on RTSimpleApp

void App::Update()
{
BaseApp::Update();

if (!m_bDidPostInit)
{
m_bDidPostInit = true;
m_special = GetSystemData() != C_PIRATED_NO;

Entity *ent = GetEntityRoot()->AddEntity(new Entity("test_hs"));
AddFocusIfNeeded(ent);

Entity* t = CreateInputTextEntity(ent, "inputssssss", 0, 0, "test");

t = CreateInputTextEntity(ent, "inputssssss2", 0, 0, "test2");
t->GetVar("pos2d")->Set(CL_Vec2f(0, 30.0f));

t = CreateInputTextEntity(ent, "inputssssss3", 0, 0, "test3");
t->GetVar("pos2d")->Set(CL_Vec2f(0, 60.0f));

t = CreateInputTextEntity(ent, "inputssssss4", 0, 0, "test4");
t->GetVar("pos2d")->Set(CL_Vec2f(0, 90.0f));
//build a dummy entity called "GUI" to put our GUI menu entities under
//Entity *pGUIEnt = GetEntityRoot()->AddEntity(new Entity("GUI"));
//MainMenuCreate(pGUIEnt);
}
}
try to type a character there, and you should get your typed character repeated 4times, if i create the InputText 2 times, the character would be repeated 3 times. Tried debug and understand the problem, but unfortunately i could not..

Enlightenment please? :prophet:

Thanks :D

Seth
03-19-2012, 11:27 AM
Thanks - Fixed on svn. This was caused by a single missing asterisk.. oopsie. :whistling:

yohanip
03-19-2012, 12:50 PM
Thanks - Fixed on svn. This was caused by a single missing asterisk.. oopsie. :whistling:

Woah.. that was fast.. :D been trying to spot the error all day long.. :sweatdrop: asteriks.. :ninja:

one question please, since i'm used to the named components, looking at EntityUtils.cpp, there are some Entity helper functions which utilize SetupInterpolateComponent and giving the interpolate component a blank name, maybe.. just maybe imho it would be better if we never assign an empty name to the component.. just my 2 cents :)

Aki Koskinen
03-19-2012, 05:13 PM
one question please, since i'm used to the named components, looking at EntityUtils.cpp, there are some Entity helper functions which utilize SetupInterpolateComponent and giving the interpolate component a blank name, maybe.. just maybe imho it would be better if we never assign an empty name to the component.. just my 2 cents :)

Very good point! Added a check to that function that ensures that no empty name is set to the InterpolateComponent.