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
-- 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