How do I set the base64 of CanvasSnapshot as a variable?

From the Asset Store
A whole set you need to create a gorgeous winter 2d game
  • Hi!

    I'm using the 'Social' plugin from armaldio which can send emails using Mandrill. There is an ability to also include an attachment, which needs to be in the form of a base64 string in the current version.

    Using System->Take Snapshot and then System->On Canvas Snapshot i'm getting everything to trigger correctly; a screenshot gets taken at the right time (which i'm testing with Browser->Invoke Download so I know that part works! ) and the email plugin successfully sends me an email. The grief i'm having is just the attachment part - what to put in the field for 'Attachment in base64'.

    So far I have been able to get it to send me a few 77B images (which are empty!) and some larger images which are the same size as the ones I get with Browser->Invoke Download but they're also empty.

    So that I can potentially use it later, I thought it would be handy to save the CanvasSnapshot base64 result as a global variable. (there's likely another way to do that, but I know I can use global variables in armaldio's plugin so i'm going running with it!) I read somewhere that there are a few (does 23 sound right?) characters at the beginning of the generated string which are not needed, so I should be removing those before saving the string as a variable - correct me on that if i've misunderstood.

    Hoping someone can guide me in the right direction!

    TLDR: I want to set the base64 string of CanvasSnapshot as a global variable. How could I do this?

    Thanks in advance!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Happy to send some money via PayPal for help on this one as it is getting a little urgent. Have also posted in the Job Offer forum, so if you believe it to be worth some money to send me some code, feel free to PM a figure to me. I'm a bit of a sharing is caring person though, so i'm hoping to create a tutorial with a step by step of what I end up doing to help everyone else out!

    Cheers

  • That may sound stupid but... doesn't setting the variable to variable to CanvasSnapshot when it is ready do it?

  • Thanks Aphrodite; that's what I did but it was emailing me an 'image' of the same size which was un-openable. Got a reply from the plugin's owner though; in the 'attachment' field I need to put

    tokenat(canvassnapshot, 1, ",")[/code:2fw2sm94]
    which sends through everything fine.
    Hooray!
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)