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
Radio Button Groups
myMailTo
RGB to HSV, HSV to RGB
Roil-Alphamania
Refine a search - Valentina
Set WarpMode of a QTVR Sprite
Replace embedded fonts in text/field and button members
Rollover Sound
Macromedia Director Game Development: From Concept to Creation
Copy matching Pixels
 

 

 

Behavior Bevel Drag Light-Alphamania

Added on 6/10/1999

 

Compatibilities:
D6_5 D7 D8 Mac PC Script

This item has not yet been rated

Author: MediaLab (website)

Requires Effector Set 2. These behaviors are for use with the Alphamania Xtra and its add-on effector sets.

property sNum
property mode -- static, follow sprite, follow mouse
property lightSprite -- sprite to use for follow sprite
property bevel
property red, green, blue
property strength
property crop
property radius

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, #bevel, [#comment: "Bevel:", #format: #integer, #default: 5, #range: [#max: 25, #min:0]]
  addProp list, #red, [#comment: "Red:", #format: #integer, #default: 255, #range: [#max: 255, #min:0]]
  addProp list, #green, [#comment: "Green:", #format: #integer, #default: 255, #range: [#max: 255, #min:0]]
  addProp list, #blue, [#comment: "Blue:", #format: #integer, #default: 255, #range: [#max: 255, #min:0]]
  addProp list, #strength, [#comment: "Strength:", #format: #integer, #default: 0, #range: [#max: 255, #min:0]]
  addProp list, #crop, [#comment: "Bevel Crop:", #format: #integer, #default: 255, #range: [#max: 255, #min:0]]
  addProp list, #radius, [#comment: "Radius:", #format: #integer, #default: 100, #range: [#max: 1000, #min:0]]
  return list
end

-- apply the bevel effect
on beginSprite me
  set sNum = the spriteNum of me
  set animMode = #relativeToPoint
  bevel(sprite sNum, [#animMode: animMode, #bevel: bevel, #red: red, #green: green, #blue: blue, #strength: strength, #bevCrop: crop, #radius: radius, lightRelToSprite:FALSE ])
end

on mouseDown me
  DragLight(me)
end

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

-- update light location if needed
on SetBevel me
  
  set x = the mouseH
  set y = the mouseV
  
  bevel(sprite sNum, [#lightLocX: x, #lightLocY: y])
end

 


Contact

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

Send e-mail