Jump to content

Screenshot adding a callback to a callback


joeBImagine
 Share

Recommended Posts

Hello Babylon community!! I have a query concerning implementing a callback in a callback for taking a screenshot of cameras.  I have this function call 

createCameraView: function (camera)
{
    let src;
    BABYLON.Tools.CreateScreenshot(engine, camera,  { width: 293, height: 150 }, function (data) { src = data; });
    return src;
},

the callback function actually saves out the image for each camera (including the hidden on's) in the scene as a base64 to the images src tag, but that saving part takes time.  The part that I am confused about is actually setting up a callback for the callback, that lets me know when the image itself is done rendering.  I am sorry I do not have a playground as most of this code is internal.  And also please forgive me if this is not enough information to understand my issue.  Cheers!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...