Search content:

 

Personal Menu
Username:
Password:
Save password

Become a member

Forgot Password?

 

Don't miss these
cXtraInfo
Wondershare Flash SlideShow Builder
Distance Sensitive Button
Sprite on/off
Exit Browser
Fill using setPixel
Flashation Flash Menu Builder
cXtraPrinterDoc
Cross-platform scripting differences: Sorted Lists
Inside Macromedia Director 6 with Lingo with CDROM
MediaMacros Xtras Mall
 

 

 

Behavior Vector Shape - Create Grid

Added on 2/7/2006

 

Compatibilities:
D8 D8_5 D9 Mac PC

This item has not yet been rated

Author: Chunick (website)

This custom handler will create a grid pattern. One key thing to remember with all vector shapes is that there is a size limit of 2798 pixels wide or high. The first four parameters are self-explanatory. The last one, autoSize, when set to True, will set the width and height of the rows and colums to fit within the width and height specified... otherwise, the width and height are the values for each grid so a 25px by 25 px grid square at 5x5 squares would be 125x125 pixels wide by high... but with autoSize, if width and heigh were set to 100 each and the number of columns and rows were set to 4 and 5 then an individual square would be 25x20.

on createGrid (width, height, rows, cols, autoSize)
  
  vertList = []
  
  if autoSize then
    w = width / float(rows)
    h = height / float(cols)
  else  
    w = width
    h = height
  end if
  
  baseRect = [[#vertex: point(0, 0)], [#vertex: point(w, 0)], [#vertex: point(w, h)], [#vertex: point(0, h)]]
  
  rows = rows - 1
  cols = cols - 1
  
  repeat with x = 0 to rows
    repeat with y = 0 to cols
      thePoint = point(w * x, h * y)
      repeat with i in baseRect
        vertList.add(i + thePoint)
      end repeat
      vertList.add([#newCurve])
    end repeat
  end repeat
  vertList.deleteAt(vertList.count)
  
  return vertList
  
end

 


Upload Provided by ABCUpload ASP

Contact

MMI
22 West Court Sq
Suite 2C
Newnan, GA 30263
USA

Fax - (206) 339-5833

Send e-mail