Contents
Articles
Behaviors
Books
Director News
Director Web Sites
FAQ
Games
Mailing Lists
News Groups
Project Examples
Reviews
Software
Tools
Useful Web Sites
Utilities
Xtras

Don't miss these
MIAW communication
NTI CD Maker
Change ShapeType of a Shape cast member
Generic behavior to copy a file
Hold for MPEG then go to marker X
How do I check if a user has the needed fonts on their machine?
DirSaver
Drop File
convert to upper or to lowercase
Narration Tool
 

 

 

Behavior Drag Light-Alphamania

Added on 6/10/1999

 

Compatibilities:
D6_5 D7 D8 Mac PC Script

Required Xtras:
Alphamania
Effector Set II for Alphamania

Rating:

Author: MediaLab (website)

Requires Effector Set 2.

property sNum
property mode -- static, follow sprite, follow mouse
property lightSprite -- which sprite to follow
property transparency
property red, green, blue
property feather
property offsetX, offsetY

on getBehaviorDescription me
  return "Move the light source of the sprite around by clicking on the sprite and dragging."
end

on getPropertyDescriptionList me
  set list = [:]
  
  addProp list, #transparency, [#comment: "Transparency:", #format: #integer, #default: 200, #range: [#max: 255, #min:0]]
  addProp list, #red, [#comment: "Red:", #format: #integer, #default: 0, #range: [#max: 255, #min:0]]
  addProp list, #green, [#comment: "Green:", #format: #integer, #default: 0, #range: [#max: 255, #min:0]]
  addProp list, #blue, [#comment: "Blue:", #format: #integer, #default: 0, #range: [#max: 255, #min:0]]
  addProp list, #feather, [#comment: "Feather:", #format: #integer, #default: 0, #range: [#max: 4, #min:0]]
  addProp list, #offsetX, [#comment: "Offset X:", #format: #integer, #default: 4]
  addProp list, #offsetY, [#comment: "Offset Y:", #format: #integer, #default: 4]
  return list
end

-- apply the drop shadow effect
on beginSprite me
  set sNum = the spriteNum of me
  set animMode = #relativeToPoint
  dropShadow(sprite sNum, [#animMode: animMode, #transparency: transparency, #red: red, #green: green, #blue: blue, #feather: feather, #xOffSet: offsetX, #yOffSet: offsetY])
end

on mouseDown me
  DragLight(me)
end

on DragLight me
  repeat while the mouseDown
    SetShadow(me)
    updateStage
  end repeat
end

-- new light settings if needed
on setShadow me
  set x = the mouseH
  set y = the mouseV
  dropShadow(sprite sNum, [#lightLocX: x, #lightLocY: y])
end

 


Contact

MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA

Send e-mail