Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (effectSprite == null){
- effectSprite = new FlxSprite().makeGraphic(FlxG.width, FlxG.height);
- var wave:FlxWaveEffect = new FlxWaveEffect(FlxWaveMode.START, 2, FlxG.width/2, 2, 5, FlxWaveDirection.HORIZONTAL);
- var water:FlxEffectSprite = new FlxEffectSprite(effectSprite, [wave]);
- water.camera = FlxG.cameras.list[1];
- add(water); //adds the wavey water
- }
- var w:FlxPoint = new FlxPoint(0 - FlxG.camera.scroll.x, 112 - FlxG.camera.scroll.y);
- effectSprite.visible = false;
- effectSprite.drawFrame();
- if (w.y < 0) w.y += Math.abs(w.y);
- if (w.x < 0) w.x += Math.abs(w.x);
- var screenPixels:BitmapData = effectSprite.framePixels;
- if (FlxG.renderBlit){
- var copyArea:Rectangle = new Rectangle(w.x, w.y, FlxG.width, FlxG.height);
- effectCam.x = copyArea.x;
- effectCam.y = copyArea.y;
- screenPixels.copyPixels(FlxG.camera.buffer, copyArea, new Point());
- }else{
- var copyArea:Rectangle = new Rectangle(0, 0, FlxG.width, FlxG.height);
- screenPixels.draw(FlxG.camera.canvas, null, null, null, copyArea);
- effectCam.x = w.x;
- effectCam.y = w.y;
- effectCam.scroll.x = w.x;
- effectCam.scroll.y = w.y;
- }
- effectCam.color = 0xFF8AFFFF;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement