trimmed mobile.
This commit is contained in:
@@ -7,7 +7,7 @@ import com.badlogic.gdx.*;
|
||||
import com.badlogic.gdx.backends.iosrobovm.*;
|
||||
|
||||
import org.robovm.apple.foundation.*;
|
||||
import org.robovm.apple.uikit.*;
|
||||
import org.robovm.apple.uikit.UIApplication;
|
||||
import org.robovm.apple.glkit.GLKViewDrawableColorFormat;
|
||||
import org.robovm.apple.glkit.GLKViewDrawableDepthFormat;
|
||||
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
package advent.core;
|
||||
|
||||
import org.robovm.apple.uikit.*;
|
||||
import org.robovm.apple.coregraphics.*;
|
||||
import org.robovm.apple.foundation.*;
|
||||
import com.badlogic.gdx.*;
|
||||
import com.badlogic.gdx.graphics.*;
|
||||
import com.badlogic.gdx.backends.iosrobovm.*;
|
||||
|
||||
public class Saver {
|
||||
|
||||
public static Pixmap flipPixmap(Pixmap src) {
|
||||
final int width = src.getWidth();
|
||||
final int height = src.getHeight();
|
||||
Pixmap flipped = new Pixmap(width, height, src.getFormat());
|
||||
|
||||
for (int x = 0; x < width; x++) {
|
||||
for (int y = 0; y < height; y++) {
|
||||
flipped.drawPixel(x, y, src.getPixel(x, height - y -1));
|
||||
}
|
||||
}
|
||||
return flipped;
|
||||
}
|
||||
|
||||
public static UIImage takeScreenshot(){
|
||||
|
||||
UIImage newImage;
|
||||
//((IOSApplication) Gdx.app).getUIViewController().getView().setTransform(CGAffineTransform.createScale(1, -1));
|
||||
UIView view = ((IOSApplication) Gdx.app).getUIViewController().getView();
|
||||
UIGraphics.beginImageContext(new CGSize(view.getFrame().getWidth(), view.getFrame().getHeight()), true, 0.0);
|
||||
view.drawViewHierarchy(
|
||||
new CGRect(0, 0, view.getFrame().getWidth(), view.getFrame().getHeight()), true);
|
||||
newImage = UIGraphics.getImageFromCurrentImageContext();
|
||||
UIGraphics.endImageContext();
|
||||
//((IOSApplication) Gdx.app).getUIViewController().getView().setTransform(CGAffineTransform.createScale(1, 1));
|
||||
return newImage;
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user