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
First Class Text Picture
DirectOS Xtra
Cast Control
Director in a Nutshell
Base64 Xtra
System Tools
Vector Shapes - Create Spiral & Create Spiral Twist
Components for multimedia applications developers
80's Arcade High Score Name Entry Behavior
Get Least Common Denominator
 

 

 

Behavior ToolTips for Shockwave 3D

Added on 9/4/2002

 

Compatibilities:
D8_5 D9

This item has not yet been rated

Author: tushonline (website)

This allows you to bring toolTips for 3d models inside 3d Sprite when mouse is over any model

---"ToolTip" Behavior Script for shockwave 3d cast members.
---- This allows you to bring toolTip for 3d models inside 3d Sprite when mouse is over any model
------ do not alter any of the script other than font, size etc. if you are not familier with the code,
------- if you are then do anything with the script.
--------- This script provided AS IS & tested.
----------- if you can improvise in this then please do & donot forget to send me a copy.
------------- This script uses Overlay function of shockwave 3d.
--------------- tushonline@hotmail.com, / run4fx@run4fx.com

-- ATTACH THIS SCRIPT TO 3D SPRITE


-- #Defining global variables
global gWorld,gtoolTip,oldtext,textMem, myMember


-- # Created new castMembers, textures, overlays to use for gtoolTip
on beginSprite me
  
  textMem = new(#text) -- Creates new text member to get Model Name
  textMem.name = "toolTipText" -- Name for the text member
  
  myMember = sprite(the currentSpriteNum).member -- 3d member of current sprite
  gWorld = myMember
  gWorld.resetWorld()
  
  gtoolTip = new (#bitmap) -- creates a new bitmap to be used for model overlay texture
  
  tmpTxt = member("toolTipText") -- temp text in this member
  tmpTxt.text = " " -- default text of Member
  tmpTxt.font = "Verdana" -- Font for gtoolTip
  tmpTxt.fontSize = 12 -- font Size for gtoolTip
  tmpTxt.alignment = #left -- Alignment for gtoolTip
  tmpTxt.color = rgb(255,255,255) -- gtoolTip Color
  gtoolTip.image = tmpTxt.image --
  gtoolTips = gWorld.newTexture("toolTip", #fromCastMember, gtoolTip) -- New texture for Overlay
  gWorld.camera[1].addOverlay(gtoolTips, point(100,100),0) -- Adds Overlay
  
end repeat
end


--- # Attaching gtoolTip with the Mouse.

on exitFrame me

mousePt = the mouseLoc - point(sprite(1).left, sprite(1).top)
mList = sprite(1).camera.modelsUnderLoc(mousePt,1,#detailed)
if mList.count > 0 then
modelName = mList[1].model.name
else
modelName = ""
end if
if modelName <> oldtext then
oldtext = modelName
tmpTxt = member("toolTipText")
tmpTxt.text = string(modelName)
gtoolTip.image = tmpTxt.image

nametx = gWorld.texture("toolTip")
nametx.member = gtoolTip
nametx.quality = #high
nametx.RenderFormat = #rgba8888

gWorld.camera[1].overlay[1].loc = mousePt+point(10,15)
end if
end


-- # Erases cast members created with beginSprite.
on EndSprite me
gtoolTip.erase()
textMem.erase()
myMember.resetWorld()
end


on getBehaviorDescription me
return "This behavior allows you to see toolTips when mouse rolls over models in shockwave 3d." &return& "Attach this behavior to your 3d sprite" &return& "tushonline@hotmail.com"
end


on getBehaviorgtoolTip me
return "This behavior allows you to see toolTips when mouse rolls over models in shockwave 3d." &return& "Attach this behavior to your 3d sprite" &return& "tushonline@hotmail.com"
end

 


Contact

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

Send e-mail