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
StuntRacer
Larger Graphics in Director than outside
Composite Xtra
A Lingo Timer Script
SetMouseLoc Xtra
Triming spaces from string
Menus like VB
Quiz engine
Amara Flash Photo Animation Software
Distance Sensitive Button
 

 

 

Behavior Remove border behavior

Added on 9/18/2001

 

Compatibilities:
behavior D8 D8_5 Mac PC

This item has not yet been rated

Author: MatthijsKlinkert (website)

This behavior removes the 1 pixel black border from projectors.

-- This behaviour does the following:
-- If it finds the stage to be smaller or equal than the current screenresolution
-- it resizes the stage to that resolution, but sets the drawrect to the source.
-- It thereby removes the dreaded 1 pixel black border. If the screenresolution is
-- smaller than the stage, this behaviour only rescales the stage to fit the displayresolution.

-- This behaviour is set to only work in projector mode and is not intended to work
-- as a shockwave movie.

-- Events
on prepareFrame(me)
  if me.isProjector() then
    me.redrawStage()
  end if
end

-- Private
on isBiggerThanScreen(me, aRect)
  -- Check if the stage is bigger than the screen resolution
  return (aRect.width > (the desktopRectList)[1].width)
end

on isProjector(me)
  -- check if running in projector mode
  return not (the runMode contains "author")
end

on redrawStage(me)
  lRect = (the desktopRectList)[1]  
  if me.isBiggerThanScreen((the stage).sourceRect) then
    -- set the new drawrect to the size of the screen resolution
    lNewDrawRect = lRect
  else
    -- set the new drawRect to the sourcerect of the stage
    lNewDrawRect = (the stage).sourceRect
  end if
  -- First resize the stage
  (the stage).rect = lRect
  -- Then resize the drawrect
  (the stage).drawRect = lNewDrawRect
end

-- Behaviour description
on getBehaviorDescription
  return "This behaviour does the following:"&RETURN&\
"If it finds the stage to be smaller or equal than the current screenresolution. \
It resizes the stage to that resolution, but sets the drawrect to the source. \
It thereby removes the dreaded 1 pixel black border. If the screenresolution is \
smaller than the stage, this behaviour only rescales the stage to fit this resolution. \
Use this behavior in the first frame of your movie"&RETURN&RETURN&\
"This behaviour is set to only work in projector mode and is not intended to work \
as a shockwave movie."&RETURN&RETURN&\
"©2001 Zicht B.V. www.zicht.nl, written by Matthijs Klinkert"
end

 


Contact

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

Send e-mail