Code: Select all
set-campos 100 200 30
Code: Select all
set-camera-position 100 200 30
Code: Select all
set-campos 100 200 30
Code: Select all
set-camera-position 100 200 30
Code: Select all
clock={}
clock.overlay = OverlayManager:createOverlay()
clock.panel = Panel( 0, 738/768, 300/1024, 30/768 )
clock.panel.element:setMaterialName( "gui/dialog.background" )
clock.overlay:add2D( clock.panel.element )
clock.text = Text( 150/1024, 5/786, "Clock" )
clock.panel:addChild( clock.text )
function clock.update()
while clock.stop == false do
clock.text.element:setParameter('caption', os.date() )
wait(1)
end
end
clock.stop = false
createTask( clock.update )
clock.overlay:show()
Your Lua solution too !merlinblack wrote:Very cool!
Code: Select all
require 'mylibrary'
Gosh! Been busy huh?jacmoe wrote:I did a TinyScheme interpreter as well.
TinyScheme is the interpreter used in Script-Fu for the Gimp.
I'll put it up there - or link to it.
Code: Select all
else if (*pos =='\t')
{
line.push_back (' '); ///< Push at least 1 space
column++;
while ((column%tabWidth)!=0) ///< fill until next tabWidth
{
line.push_back (' ');
column++;
}
}
Code: Select all
if( *pos == '\n' || column > CONSOLE_LINE_LENGTH )
Code: Select all
void LuaConsole::print( std::string text )
{
string line;
string::iterator pos;
int column;
pos = text.begin();
column = 1;
while( pos != text.end() )
{
if( *pos == '\n' || column > CONSOLE_LINE_LENGTH )
{
lines.push_back( line );
line.clear();
if( *pos != '\n' )
--pos; // We want to keep this character for the next line.
column = 0;
}
else if (*pos =='\t')
{
// Push at least 1 space
line.push_back (' ');
column++;
// fill until next multiple of CONSOLE_TAB_STOP
while ((column % CONSOLE_TAB_STOP )!=0)
{
line.push_back (' ');
column++;
}
}
else
{
line.push_back( *pos );
column++;
}
pos++;
}
if( line.length() )
{
if( lines.size() > CONSOLE_MAX_LINES-1 )
lines.pop_front();
lines.push_back( line );
}
// Make sure last text printed is in view.
if( lines.size() > CONSOLE_LINE_COUNT )
start_line = lines.size() - CONSOLE_LINE_COUNT;
textChanged = true;
return;
}
I'll *hopefully* give my project a test run on Windows this weekend - and specifically run a test in Release. I think it's vs2005 I have installed , been awhile since I booted Windows at home!KakCAT wrote:I suppose the answer is no, but has anyone had problems with the LuaConsole in release mode? (vs2005, sp1)
I'm getting a fault in frameStarted (in the 'text' object)
Code: Select all
Ogre::LogManager::getSingletonPtr()->logMessage("*** Initializing OIS ***");
OIS::ParamList pl;
size_t windowHnd=0;
std::ostringstream windowHndStr;
pWindow->getCustomAttribute("WINDOW",&windowHnd);
windowHndStr<<windowHnd;
pl.insert(std::make_pair(std::string("WINDOW"),windowHndStr.str()));
m_pInputManager=OIS::InputManager::createInputSystem(pl);
m_pKeyboard=static_cast<OIS::Keyboard*>(m_pInputManager->createInputObject(OIS::Type::OISKeyboard,true));
m_pKeyboard->setTextTranslation(OIS::Keyboard::TextTranslationMode::Unicode); //I added this thinking it'll help, it didn't :(
m_pMouse=static_cast<OIS::Mouse*>(m_pInputManager->createInputObject(OIS::Type::OISMouse,true));
Ogre::WindowEventUtilities::addWindowEventListener(pWindow,this);
m_pKeyboard->setEventCallback(this);
m_pMouse->setEventCallback(this);
>_< yup your spot on. I was using key up events so that answer wasn't vague at all!merlinblack wrote:Its been awhile since I've looked at OIS (it's working in my project, so I haven't touched it) but I remember that it only fills in the 'text' member on Key Down events, and that buffered vs non-buffered may have an effect too. Sorry for the vague answer - I'm at work.
Short Answer: It overrides it, yes.Yati wrote:I do have another question though. In the consolePrint.lua file the function myprint replaces the default print? Override it?
Thanks!shanefarris wrote:Merlin, I like the console you created and I took a look at your test engine, and I really like the use of scripts in your engine too. For the most part when I see projects utilizing scripting abilities, most people will use Lua, or whatever as data for level loading and things like that. I think scripting data is ok if that's what you need it for, but you can do so much more with it like actually create logic with it. I like using a DB for data, and scripting for logic, and looks like you've utilized Lua very nicely.
How can I use this console to control ogre like this video?
Code: Select all
~MyFrameListener()
{
mKeyboard->setEventCallback(0);
}
Hi all,
I know its an old topic, but maybe someone has an answer:
I'm also want to use the lua console to print out results. For example:
If I print 1 + 2, I want the result placed in the console. In this case 3
print(1 + 2)
\>> 3
Has anbody an idea how to accomplish that?
Best Regards
Lax
http://www.lukas-kalinowski.com/Homepage/?page_id=1631
Please support Second Earth Technic Base built of Lego bricks for Lego ideas: https://ideas.lego.com/projects/81b9bd1 ... b97b79be62