local obj = game.CurrentObject:getName()
if Conditions["slowPC"].Value then
if obj == "LEFT" then
game.FadeEffect = eFadeIn
elseif obj == "LEFT1" then
...
elseif obj == "RIGHT" then
...
elseif obj == "RIGHT1" then
...
end
end
Effect for fade in/out of a scene.
'0' (eFadeNo): no effect. display new scene immediately.
'1' (eFadeIn): fade in. Only fade in new scene. No fade out of current scene.
'2' (eFadeOut): fade out. Only fade out current scene. No fade in of new scene.
'3' (eFadeInAndOut): fade in/out. Fade out current scene and fade in new scene.
'4' (eFadeToNew): fade to new. Use alpha-blending to directly fade from current to new scene.
'5' (eShiftLeft): shift left. Shift current scene to the left and show new scene.
'6' (eShiftRight): shift right. Shift current scene to the right and show new scene.
'7' (eTunnelEffect): tunnel effect. Use a tunnel effect for fade in/out.
system.cursor = Cursors["example"]
--[[
Available effects for fading in/out of a scene.
'0' (eFadeNo): no effect. display new scene immediately.
'1' (eFadeIn): fade in. Only fade in new scene. No fade out of current scene.
'2' (eFadeOut): fade out. Only fade out current scene. No fade in of new scene.
'3' (eFadeInAndOut): fade in/out. Fade out current scene and fade in new scene.
'4' (eFadeToNew): fade to new. Use alpha-blending to directly fade from current to new scene.
'5' (eShiftLeft): shift left. Shift current scene to the left and show new scene.
'6' (eShiftRight): shift right. Shift current scene to the right and show new scene.
'7' (eTunnelEffect): tunnel effect. Use a tunnel effect for fade in/out.
]]
local t_fade = {
["left"] = { effect = eFadeIn, delay = 100, cursor = "arrow_left" },
["left1"] = { effect = eShiftLeft, delay = 500, cursor = "arrow_left" },
etc...
}
local current_obj = nil
function onMouseEvent(eventType, mousePosition)
if eventType == eEvtMouseMove and not game.CurrentScene.IsMenu then
if not game.CurrentObject:isEmpty() then -- check if current object exists
if string.lower(game.CurrentObject:getName()) ~= current_obj then
current_obj = string.lower(game.CurrentObject:getName()) -- store name of current object in lowercase
-- + --
if t_fade[current_obj] ~= nil then
game.FadeEffect = t_fade[current_obj].effect -- update fade effect
game.FadeDelay = t_fade[current_obj].delay -- update fade delay
system.cursor = Cursors[ t_fade[current_obj].cursor ] -- set a new cursor
end
end
elseif game.CurrentObject:isEmpty() and current_obj ~= nil then
current_obj = nil -- reset current_obj back to nil
game.FadeEffect = eFadeInAndOut -- specify default fade effect
game.FadeDelay = 600 -- specify default fade delay
system.cursor = Cursors["default"] -- specify the default cursor
end
end
end
registerEventHandler("mouseEvent", "onMouseEvent")