Disabling T-Engine mouse cursor

If you have a module that you'd like comments on or would like to know how to create your very own module, post here

Moderator: Moderator

Post Reply
Message
Author
Grey
Loremaster
Posts: 3517
Joined: Thu Sep 23, 2010 10:18 pm
Location: London, England
Contact:

Disabling T-Engine mouse cursor

#1 Post 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).
http://www.gamesofgrey.com - My own T-Engine games!
Roguelike Radio - A podcast about roguelikes

darkgod
Master of Eyal
Posts: 10750
Joined: Wed Jul 24, 2002 9:26 pm
Location: Angolwen
Contact:

Re: Disabling T-Engine mouse cursor

#2 Post 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
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)

Grey
Loremaster
Posts: 3517
Joined: Thu Sep 23, 2010 10:18 pm
Location: London, England
Contact:

Re: Disabling T-Engine mouse cursor

#3 Post 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.
http://www.gamesofgrey.com - My own T-Engine games!
Roguelike Radio - A podcast about roguelikes

darkgod
Master of Eyal
Posts: 10750
Joined: Wed Jul 24, 2002 9:26 pm
Location: Angolwen
Contact:

Re: Disabling T-Engine mouse cursor

#4 Post by darkgod »

I'm not sure what you want exactly ?
What should pause ?
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)

Grey
Loremaster
Posts: 3517
Joined: Thu Sep 23, 2010 10:18 pm
Location: London, England
Contact:

Re: Disabling T-Engine mouse cursor

#5 Post 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.
http://www.gamesofgrey.com - My own T-Engine games!
Roguelike Radio - A podcast about roguelikes

darkgod
Master of Eyal
Posts: 10750
Joined: Wed Jul 24, 2002 9:26 pm
Location: Angolwen
Contact:

Re: Disabling T-Engine mouse cursor

#6 Post 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
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)

Grey
Loremaster
Posts: 3517
Joined: Thu Sep 23, 2010 10:18 pm
Location: London, England
Contact:

Re: Disabling T-Engine mouse cursor

#7 Post by Grey »

It's mostly for dramatic effect. 'Juicing' as I it's referred the in the indie scene.
http://www.gamesofgrey.com - My own T-Engine games!
Roguelike Radio - A podcast about roguelikes

chezzo
Higher
Posts: 55
Joined: Thu Aug 16, 2012 10:52 pm
Location: Philadelphia, Pennsylvania, USA
Contact:

Re: Disabling T-Engine mouse cursor

#8 Post 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.

Post Reply