Page 1 of 1

Disabling T-Engine mouse cursor

Posted: Sat Aug 04, 2012 9:43 am
by Grey
Is there a way to use the OS cursor in modules without changing people's ToME settings? Oh, and same for the metal UI scheme (I'd like to use the old stone style).

Re: Disabling T-Engine mouse cursor

Posted: Sun Aug 05, 2012 11:21 am
by darkgod
For the UI, in your load.lua near the top; do:

Code: Select all

local UIBase = require "engine.ui.Base"
UIBase.ui = "stone"
For the mouse, in your Game.lua define two methods:

Code: Select all

function _M:setMouseCursor()
	core.display.setMouseCursor(0, 0, nil, nil)
end

function _M:updateMouseCursor()
	core.display.setMouseCursor(0, 0, nil, nil)
end

Re: Disabling T-Engine mouse cursor

Posted: Mon Aug 06, 2012 12:44 pm
by Grey
Thanks! Works great :)

Another little question - how do I get the game to pause for a fraction of a second? I can't find a good generic lua answer, and figured there must be something built into the engine, but can't find anything in the luadoc.

Re: Disabling T-Engine mouse cursor

Posted: Mon Aug 06, 2012 10:23 pm
by darkgod
I'm not sure what you want exactly ?
What should pause ?

Re: Disabling T-Engine mouse cursor

Posted: Mon Aug 06, 2012 10:52 pm
by Grey
Game input and further actions, but graphical effects should continue. In Rogue Rage one of the attacks does a chain lightning style thing through several enemies, but moves the player about as it does so, but it's confusing because it happens in an instant. I'd like a 10ms pause between jumps to show what's going on.

Re: Disabling T-Engine mouse cursor

Posted: Mon Aug 06, 2012 11:07 pm
by darkgod
Well just set a flag at the start and end and check it in your mouse/lkeyboard input.
As for doing something with a delay, it depends, if it's a particle you can have a callback when the particle ends. IE:

Code: Select all

game.level.map:particleEmitter(x, y, 1, "some_particle").on_remove = function()
....
....
end

Re: Disabling T-Engine mouse cursor

Posted: Tue Aug 07, 2012 12:29 am
by Grey
It's mostly for dramatic effect. 'Juicing' as I it's referred the in the indie scene.

Re: Disabling T-Engine mouse cursor

Posted: Sun Sep 02, 2012 11:52 am
by chezzo
I needed to do this because when monsters would spend their action points, the flyers would be all on top of each other and other monsters would warp all over the board.

I used:

Code: Select all

core.game.sleep(100)
That pauses the engine for 100ms.