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
Director 8 Demystified
Base64 Xtra
MIDI Class
Creating a Game Environment
Sliding menu
RGB to CMYK
Image Flood Fill (Using getPixel and setPixel)
LiveCD
Seurat-Alphamania
Macromedia Director 8.5 Shockwave Studio for 3D: Training from the Source
 

 

 

Behavior Sprite Expander

Added on 11/6/2000

 

Compatibilities:
behavior D7 D8 Mac PC Shockwave

This item has not yet been rated

Author: KurtKoenig (website)

This behavior expands the size of a sprite on mousewithin,With parameters to change the width, height, and expanding speed. Use this behavior on a bitmap, or vectorshape-sprite

--------- SPRITEXPANDER _____________________________________________________________________
--___________________________________________________________________________________________
--
-- this behavior expands the size of a vector, or bitmap-sprite when the mousecursor
-- is over this sprite. It can be used as RollOver-Expander in a single frame.
--
--  11/04/2000                       D 7 , D 8
--                                  
--  Kurt Koenig * Belgium                                  
--
--____________________________________________________________________________________________

----------------------------------------------------------------------------------------------



property pTheWidth
property pTheHeight
property pLargeWidth
property pLargeHeight
property pExSpeed


on getPropertyDescriptionList
  desclist = [:]
  addprop desclist, #pLargeWidth,[#comment:
"The size (Width) in pixels when the mouse is over this sprite:",
  format: #integer , default: "20"]
  addprop desclist, #pLargeHeight,[#comment:
"The size (Height) in pixels when the mouse is over this sprite:",
  format: #integer , default: "20"]
  addprop desclist, #pExSpeed, [ #comment:
  "The speed when the sprite"s expanding :",
  #format: #integer, #range:[#min: 1, #max: 10],
  #default: "10"]
  return desclist
end getPropertyDescriptionList

on getBehaviorDescription
  return " This behavior expands the size of a sprite on"&return&"
mousewithin,With parameters to change the width, "&return&"
height, and expanding speed. Use this behavior"&return&"
on a bitmap, or vectorshape-sprite          Kurt * Belgium"
end getBehaviorDescription


on getBehaviorTooltip me
  return "Increase the size of a sprite"&return&"
on RollOver in a single frame."
end getBehaviorTooltip

on beginsprite me
  pTheWidth = sprite (me. spritenum) . width
  pTheHeight = sprite (me. spritenum) . height
end beginsprite

on mousewithin me
  if sprite(me.spriteNum).width <= pLargeWidth - pExSpeed then
    sprite(me.spriteNum).width = sprite(me.spriteNum).width + pExSpeed
  end if
  if sprite(me.spriteNum).height <= pLargeHeight - pExSpeed then
    sprite(me.spriteNum).height = sprite(me.spriteNum).height + pExSpeed
  end if
  cursor 200
end mousewithin

on mouseleave me
  sprite(me.spriteNum).width = pTheWidth
  sprite(me.spriteNum).height =  pTheHeight
  cursor 0
end

 


Contact

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

Send e-mail