Adds a simple API that allows programmers to add the ability to take screenshots with their mods. Modders can now add filters using different combinations of color at different brightnesses and transparencies!
THE API IS COMPLETE, SO I'LL ONLY BE UPDATING IT AS NEW FORGE VERSION ARRIVE
Be sure to add CameraAPI.jar to the External Jars in your project and DO NOT ADD 'CameraAPI.jar' TO YOUR MODS FOLDER. Bad things will happen if you do! Also, be wary of using too many laggy filters, as this could cause the screenshot saver to bug out and pick up your desktop.
@EventHandler
public void preInit(FMLPreInitializationEvent event){
MinecraftForge.EVENT_BUS.register(this);
//You could also use a tick handler to bind your key.
File directory = new File(//Your//Directory//Screenshots);
if(!directory.exists()){
directory.mkdirs();
}
FrameWriter.setOutput(directory);
}
@ForgeSubscribe
public void ScreenshotListener(LivingUpdateEvent event){
if(Minecraft.getMinecraft().thePlayer != null && Minecraft.getMinecraft().currentScreen == null){
EntityPlayer thePlayer = Minecraft.getMinecraft().thePlayer;
if(thePlayer.isSneaking() && Keyboard.isKeyDown(Keyboard.KEY_P)){
BufferedImage image = CameraHelper.takeScreenShot();
Frame frame = Frame.getFrameFromBufferedImage(image);
//Filter.overlayFrameFromColor(frame, color, transparency);
//Filter.setBrightness(frame, brightness);
FrameWriter.saveFrameAsImage(frame);
}
}
}
Screenshots
Slight Yellow/Blue Filter With Increased Brightness
Slight Cyan/Orange Filter With Increased Brightness
As long as you leave credits in your "mod post", I don't really care what you do with it.