Mac OS X - how to darken screen?

Phil Davis revdev at pdslabs.net
Fri Sep 17 19:29:43 EDT 2010


  Thanks so much everyone! Great tips all. Here is my final code, tested on Mac 
OS X 10.5.8 and Windows 7:

command showBlackScreen pTargetScreenRect
    # pTargetScreenRect = the rect of your target screen

    -- make a 'cover' stack to fill screen
    create inv stack "screencover" -- temp stack, no need to save it
    set the backgroundColor of stack "screencover" to black
    set the blendLevel of stack "screencover" to 100 -- transparent
    palette stack "screencover" -- make this stack the frontmost layer
    set the rect of stack "screencover" to pTargetScreenRect -- make it same 
size as screen
    show stack "screencover" -- but it's still transparent

    -- make the screen go dark
    lock screen -- hide changes until all is ready for display
    set the blendLevel of stack "screencover" to 1 -- almost opaque (0 causes 
flash on Win 7)
    set the defaultStack to "screencover" -- to make dissolve work right
    unlock screen with effect dissolve fast -- to reveal black stack
end showBlackScreen



command showNormalScreen
    -- make the screen look normal again
    lock screen -- hide changes until all is ready for display
    set the defaultStack to "screencover" -- to make dissolve work right
    set the blendLevel of stack "screencover" to 100 -- transparent
    unlock screen with effect dissolve fast -- to reveal normal screen
    delete stack "screencover" -- end the stack's existence
end showNormalScreen


Best -
Phil


On 9/17/10 10:27 AM, Klaus on-rev wrote:
> Hi all,
>
> important addition!
>
>> ...
>> something like this should work:
>>
>> 1. set some properties for "the templatestack":
>> the rect to the screenrect
>> backgroundcolor to black
> decorations to empty!
>> loc to the screenloc
>> blendlevel to 100 = completely transparent
>>
>> 2. create stack "the_cover"
>> 3. set blendlevel in a repeat loop up to 0**
>> 4. Now do your work behind this stack
>> 5. set blendlevel of htat stack in a repeat loop to 0**
>> 6. Close stack "the_cover"
>>
>> ** Experiment a bit wiht the "step" in the repeat loop, maybe "step 5" or "step 10" will do
> Best
>
> Klaus
>
> --
> Klaus Major
> http://www.major-k.de
> klaus at major.on-rev.com
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>

-- 
Phil Davis

PDS Labs
Professional Software Development
http://pdslabs.net




More information about the use-livecode mailing list