Hey guys, now raised another question, I'll try to explain right.
It looks like "ActivateMouse()" should be declared in "_init()", and also you are force to declare "SetSpritePosition ( g_sprCursor, g_MouseX, g_MouseY )" at the very start of "main()"; this is right when loadgame/savegame menues, but does not fit my needs, since I'm starting level, close to the trigger item, even if player marker is outside of the scene.
Imagine the scene:
Player is walking around a town, enter in a house, enter in a room, when close to pc display he is prompted to press E to run script> and is now and only now, when the sprite base + sprite fruits + mouse cursor should appears, and mouse being activate. But if I try this, mouse does not work, do nothing.
As example:
function mouse_test_init(e)
-- cursor
g_imgCursor = LoadImage("titlesbank\\default\\cursor.png")
g_sprCursor = CreateSprite ( g_imgCursor )
ActivateMouse()
end --init
function mouse_test_main(e)
SetSpritePosition ( g_sprCursor, g_MouseX, g_MouseY )
if g_MouseClick == 1 then PromptDuration("Mouseclick is done",3000) end
end --main
The code above work, but if I do...
function mouse_test_main(e)
PromptDuration("Press E, to open fruits puzzle." ,3000)
if g_KeyPressE == 1 and npressed == 0 then
g_sprCursor = CreateSprite ( g_imgCursor )
ActivateMouse()
SetSpritePosition ( g_sprCursor, g_MouseX, g_MouseY )
end
end
It does not work, cursor appears a 0,0 and does nothing, mouse non activate, I know this because I can move camera.
And of course the rest of the code does not work, just I've pc display (trigger) and mouse, even I can move it, and so on, but does nothing, since there are not base sprite, fruits sprites, buttons sprites, and so on.
We are force to declare mouse as I said above ?
Or I'm doing something wrong?
Thanks guys 4 all feedbacks
3com
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz
OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics