Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Can you take screenshots with Codea-API in FULLSCREEN_NO_BUTTONS?

edited September 4 in Questions Posts: 130

I have a question regarding taking screenshots using the camera icon in the bottom-left corner. When using it, I was able to save the image and set it as the icon of the project. However, touching the button to tweet the screenshot closed the window and nothing else seemed to happen. Is this behaviour intentional and I'm just missing something or is this a bug?

Also, is it possible to provide this feature in an exported app (without the option of setting the screenshot as an icon)? I'd like to call the function for taking a screenshot manually by putting a button in my game. Having the option to use twitter would be great since players could share pictures of what they have accomplished. I couldn't find anything about this in the documentation. It seems as if you can't call the API for taking a screenshot and opening the menu for sharing and saving manually.


  • edited September 4 Posts: 130

    Any ideas? I haven't been able to get this to work :#

  • Posts: 1,807
    @Leon - I think it should be possible if you program a touch to initiate screen capture. But, don't forget iOS permits you to take a full screen image capture by pressing the home and power buttons at the same time briefly. So you can capture apps in use.

    This presents a small image in the bottom left hand corner to tap and then edit/save.
  • Posts: 130

    @Bri_G Thanks! When you press the camera-icon in the bottom left corner, Codea takes a picture and then opens a small menu that allows you to share the image to Twitter. That's the main thing I'd like to integrate into my game. However, I couldn't find any documentation on how to trigger that in FULLSCREEN_NO_BUTTONS, when the camera icon in the bottom left is hidden.

  • Posts: 1,807
    @Leon - you should be able to use parameter.action() to make a call for saveImage() to copy the screen. You could set it up for a multiple tap in the touched() function and switch to display mode(FULL SCREEN) before capturing the screen. Note I think it will record two images normal res and retina res.
  • edited September 4 Posts: 130

    @Bri_G Thanks again! The problem is that this doesn't sound like a practical solution since I'd like to publish my game on the AppStore. Also, my issue isn't taking a screenshot, but that I'd like to trigger the exact action touching that the camera icon has. Meaning that after taking a screenshot, the menu that allows you to twitter the screenshot opens up. Is there a function that replicated the exact action of the camera icon?

    Edit: Maybe this can be done using openURL. I'll give it a try

  • Posts: 1,807

    @Leon - take a snapshot of your screen now (using the iOS method. Tap the small icon of it in the bottom right corner and open the editing page. Look at the top right corner of the screen and you can see the sharing icon - tap on that to see what sharing options you have.

  • Posts: 130

    @Bri_G Yes, but that's too inconvenient for most players. They are used to clicking one button and being presented with a pre-made tweet that includes a hashtag as well as the image. Otherwise, they probably won't bother.
    Also, that's exactly what the camera button in Codea does. When using the tweet option, the twitter app is opened and you are presented with a pre-made tweet that includes the screenshot and a hashtag.

  • JohnJohn Admin Mod
    Posts: 629

    @Leon this is probably something that could be added to Codea's API since we already have for controlling screen capture via code

  • Posts: 130

    @John That would be awesome! The only problem could be, that the menu that opens after taking a screenshot allows you to use the image as the project icon.

Sign In or Register to comment.