matrefeytontias

HaxePunk HWImage class

Oct 1st, 2016
503
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Forces the image to hold its BitmapData status
  2.  
  3. import com.haxepunk.HXP;
  4. import com.haxepunk.RenderMode;
  5. import com.haxepunk.Graphic.ImageType;
  6. import com.haxepunk.graphics.Image;
  7. import com.haxepunk.ds.Either;
  8.  
  9. import openfl.display.BitmapData;
  10. import openfl.geom.Rectangle;
  11.  
  12. class HWImage
  13. {
  14.     @:access(com.haxepunk.ImageType)
  15.     static public function c(bd:BitmapData, ?clipRect:Rectangle) : Image
  16.     {
  17.         return new Image(HXP.renderMode == RenderMode.HARDWARE ? new ImageType(Left(bd)) : bd, clipRect);
  18.     }
  19. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×