Field drop shadow

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
kevin11
Posts: 101
Joined: Thu Aug 11, 2011 5:02 pm

Field drop shadow

Post by kevin11 » Wed Jan 18, 2012 9:46 am

Hi,

I'm having an odd problem with a field's drop shadow. In the code I am just doing :

set the shadow of field whatever to true

This seems to give an offset, flat grey shadow that lies within the field boundaries.
The property inspector shows shadow is off. Using the property inspector to switch on a drop shadow then gives a drop shadow, black, blended, outside the field boundaries where it should be. There is nothing I can do in the property inspector to turn off this "inner" drop shadow.

In code, using "set the shadow of field whatever to false" does of course remove the inner effect.

So the question is, what is the code line generating on that field, if not a drop shadow ?

Kevin

kevin11
Posts: 101
Joined: Thu Aug 11, 2011 5:02 pm

Re: Field drop shadow

Post by kevin11 » Wed Jan 18, 2012 10:03 am

and the answer is....

use "set the dropshadow"
not "set the shadow"

dictionary was a bit confusing there !

Klaus
Posts: 14194
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Field drop shadow

Post by Klaus » Wed Jan 18, 2012 1:46 pm

Hi Kevin,
kevin11 wrote:...
In code, using "set the shadow of field whatever to false" does of course remove the inner effect.
So the question is, what is the code line generating on that field, if not a drop shadow?
that line will create a custom property named "shadow" for your field! :)


Best

Klaus

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Field drop shadow

Post by jmburnod » Wed Jan 18, 2012 5:21 pm

Hi Kewin,

The dropshadow is an array property
You can set dropshadow of an object or not like that

set dropShadow["size"] of fld "myField" to 8 -- or an integer between 0 and 255
set dropShadow["size"] of fld "myField" to 0 -- dropshadow is not visible
( i write under the Klaus's control) :D


Best regards

Jean-Marc
https://alternatic.ch

Klaus
Posts: 14194
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Field drop shadow

Post by Klaus » Wed Jan 18, 2012 5:27 pm

You are a good boy, Jean-Marc! :D

Randy Hengst
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 157
Joined: Thu Jun 29, 2006 4:16 pm

Re: Field drop shadow

Post by Randy Hengst » Mon Jan 23, 2012 3:06 am

Hi Kevin,

This may be overkill for you, but I've coded drop shadows before.... here's an example that I've put in a handler associated with a mouseDown in a graphic. It would also work for a field.

set the dropShadow["color"] of target to "0,0,0"
set the dropShadow["blendMode"] of target to "normal"
set the dropShadow["opacity"] of target to "200"
set the dropShadow["filter"] of target to "gaussian" -- highest "box2pass" is medium quality
set the dropShadow["spread"] of target to "0"
set the dropShadow["size"] of target to "6"
set the dropShadow["distance"] of target to "6"
set the dropShadow["angle"] of target to "45"

You can then clear all of the dropShadow settings by

set the dropShadow of target to "false"

I've use the set to false in the mouseUp handler of the same graphics.

be well,
randy

Post Reply