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
IPIX
Initialize QuickTime Video (no white flash)
Title Bar Color Gradient Effect Behavior
Find Last Label
Hold for MPEG then go to marker X
Create a Shortcut on desktop
SpaceShooter
Tint bitmap behaviour
cXtraPrinterDoc
Res Mode
 

 

 

Behavior SpritePulsator

Added on 6/30/1999

 

Compatibilities:
behavior D7 D8 Mac PC Shockwave

This item has not yet been rated

Author: WarrenOckrassa

Causes a sprite to "pulse" in and out in opacity by settable degrees at selectable rates.

-- By Warren "The Howdy Man" Ockrassa, warren@nightwares.com
-- This causes any given sprite onscreen to "pulsate" in opacity
-- Drag and drop to invoke the GPDL, then set the max and min opacity values (in percent) as well as the step value

on GetBehaviorDescription
  set sContent = "This allows any sprite to pulsate in and out in opacity." & RETURN & RETURN & "Parameters include maximum opacity, minimum opacity, and step value."
  return sContent  
END GetBehaviorDescription

on GetBehaviorTooltip  
  set sContent = "This allows any sprite to pulsate in and out in opacity." & RETURN & RETURN & "Parameters include maximum opacity, minimum opacity, and step value."
  return sContent  
END GetBehaviorTooltip

PROPERTY pnMySprite, pbFading, pnMaximumOpacity, pnMinimumOpacity, pnFadeStep

on BeginSprite me  
  set pnMySprite = the currentSpriteNum
  set the ink of sprite pnMySprite = 32 -- blend  
END BeginSprite

on PrepareFrame me  
  if the blend of sprite pnMySprite >= pnMaximumOpacity then
    set pbFading = TRUE    
  else if the blend of sprite pnMySprite <= pnMinimumOpacity then    
    set pbFading = FALSE  
  end if  
  if pbFading then    
    set the blend of sprite pnMySprite = the blend of sprite pnMySprite - pnFadeStep    
  else    
    set the blend of sprite pnMySprite = the blend of sprite pnMySprite + pnFadeStep    
  end if  
end PrepareFrame

on GetPropertyDescriptionList me  
  if not ( the currentSpriteNum ) then    
    -- behavior has been dropped on the script channel; kickout
    exit    
  end if
  return [ #pnMaximumOpacity: [ #comment: "What is the MAXIMUM opacity you want in percent?", #format:  #integer, #default: 100, #range: [#min: 1, #max: 100] ], #pnMinimumOpacity: [ #comment: "What is the MINIMUM opacity you want in percent?", #format:  #integer, #default: 50, #range: [#min: 0, #max: 100] ], #pnFadeStep: [ #comment: "By what amount do you want the opacity to be stepped each time?", #format:  #integer, #default: 1, #range: [#min: 1, #max: 100] ] ]  
end GetPropertyDescriptionList

 


Contact

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

Send e-mail