Skip to content

Instantly share code, notes, and snippets.

@bomberstudios
Created February 8, 2011 16:01
Show Gist options
  • Save bomberstudios/816646 to your computer and use it in GitHub Desktop.
Save bomberstudios/816646 to your computer and use it in GitHub Desktop.
Creates a 400x300 PNG32 slice, ready for exporting and uploading to dribbble.com
var left = 100,
top = 100;
if (fw.selection.length) {
left = fw.selection[0].left,
top = fw.selection[0].top;
}
fw.getDocumentDOM().addNewHotspot("slice", "rectangle", {left:left, top:top, right:left + 400, bottom: top + 300});
fw.getDocumentDOM().setSliceExportOptions({ animAutoCrop:true, animAutoDifference:true, applyScale:false, colorMode:"32 bit", crop:false, cropBottom:0, cropLeft:0, cropRight:0, cropTop:0, ditherMode:"none", ditherPercent:100, exportFormat:"PNG", frameInfo:[ ], interlacedGIF:false, jpegQuality:80, jpegSelPreserveButtons:false, jpegSelPreserveText:true, jpegSelQuality:90, jpegSelQualityEnabled:false, jpegSmoothness:0, jpegSubsampling:0, localAdaptive:true, lossyGifAmount:0, macCreator:"", macFileType:"", name:"PNG 32", numCustomEntries:0, numEntriesRequested:0, numGridEntries:6, optimized:true, paletteEntries:null, paletteInfo:null, paletteMode:"adaptive", paletteTransparency:"none", percentScale:100, progressiveJPEG:false, savedAnimationRepeat:0, sorting:"none", useScale:true, webSnapAdaptive:false, webSnapTolerance:14, xSize:0, ySize:0 });
fw.getDocumentDOM().setSliceFilename("dribble");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment