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
DirectControl Xtra
XtrAgent
Advanced Lingo for Games
Hold on a frame till Flash finishes playing
XTRA dmmXSC - a client for XML Socket Server
Go Marker of a Movie in current Directory
Blinker
Shockwave Remote Faq
alt.multimedia.director
Multimixer Xtra
 

 

 

Behavior Bevel Follow Mouse or Sprite-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 "Allows you to set a sprite to a specific bevel setting. Will also allow you to lock the light location to the mouse or two another sprite."
end

on getPropertyDescriptionList me
  set list = [:]
  addProp list, #mode, [#comment: "Relative To:", #format: #symbol, #range: [#Sprite, #Mouse], #default: #Mouse]
  addProp list, #lightSprite, [#comment: "Sprite To Follow (if relevant):", #format: #integer, #default: 1]
  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])
  Add(the actorList, me)
end

on endSprite me
  set pos =   getone(the actorList, me)
  if pos then
    deleteAt(the actorList, pos)
  end if
end

on StopEffect me, sym
  -- removes this behavior from the actorList
  if not voidP(sym) then
    if sym <> #bevel then exit
  end if
  set pos =   getone(the actorList, me)
  if pos then
    deleteAt(the actorList, pos)
  end if
end

on ResumeEffect me, sym
  -- adds this behavior to the actorList
  if not voidP(sym) then
    if sym <> #bevel then exit
  end if
  set pos =   getone(the actorList, me)
  if pos = 0 then
    Add(the actorList, me)
  end if
end


-- update light location if needed
on setBevel me
  if mode = #Mouse then
    set x = the mouseH
    set y = the mouseV
  else if mode = #Sprite then
    -- IF YOU GET A SCRIPT ERROR HERE, YOU HAVE PROBABLY SPECIFIED
    -- AN INVALID SPRITE FOR THIS BEHAVIOR
    set x = the locH of sprite lightSprite
    set y = the locV of sprite lightSprite
  end if
  set x = x - the locH of sprite sNum
  set y = y - the locV of sprite sNum
  bevel(sprite sNum, [#lightLocX: x, #lightLocY: y])
end

on stepFrame me
  setBevel(me)
end

 


Contact

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

Send e-mail