Got an iPhone or iPad? We have a brand new Pastebin App for both devices, and it's totally free! Click here to download the new Pastebin App for iOS.
Guest

Untitled

By: nicotroia on Feb 17th, 2012  |  syntax: ActionScript 3  |  size: 1.01 KB  |  hits: 73  |  expires: Never
download  |  raw  |  embed  |  report abuse
Copied
  1. private function drawSafetyLines():void
  2.                 {
  3.                         var numDashes:uint = uint(stage.stageWidth * 0.125) + 1;
  4.                         var rect:Rectangle = new Rectangle(0, 0, 5, 2);
  5.                         var vec:Vector.<uint> = new Vector.<uint>();
  6.                        
  7.                         for( var i:uint = 0; i < (rect.width*rect.height); i++ ) {
  8.                                 vec.push(0x33ff0000);
  9.                         }
  10.                        
  11.                         safetyBitmap.bitmapData = new BitmapData(stage.stageWidth, stage.stageHeight, true);
  12.                        
  13.                         //Touchscreen Safety (300px)
  14.                         rect.y = (300 * stage.stageHeight)/1920;
  15.                         for( i = 0; i < numDashes; i++ ) {
  16.                                 safetyBitmap.bitmapData.setVector(rect, vec);
  17.                                 rect.x += 8;
  18.                         }
  19.                        
  20.                         //Content Safety (1620px)
  21.                         rect.x = 0;
  22.                         rect.y = (1620 * stage.stageHeight)/1920;
  23.                         for( i = 0; i < numDashes; i++ ) {
  24.                                 safetyBitmap.bitmapData.setVector(rect, vec);
  25.                                 rect.x += 8;
  26.                         }
  27.                        
  28.                         //One World Safety (1835px)
  29.                         rect.x = 0;
  30.                         rect.y = (1835 * stage.stageHeight)/1920;
  31.                         for( i = 0; i < numDashes; i++ ) {
  32.                                 safetyBitmap.bitmapData.setVector(rect, vec);
  33.                                 rect.x += 8;
  34.                         }
  35.                 }