DiegoM's Forum Posts

  • An easy way of doing it without scripting is to use the Load image from URL action on a Sprite instance.

    When that is loaded, you can use the Paste object action of Drawing Canvas to copy the image data over.

    After that you can get rid of the sprite instance.

  • Cool, well done!

    Before I forget, yesterday I found the full reference for the library, but it's a bit hidden away. It's very useful when you go past the basic examples.

    mongodb.com/docs/realm-sdks/js/latest

  • I am just guessing here, but judging from the console errors, there seem to be syntax error in either here

    const mongodb = app.services.mongodb("mongode-atlas");
    

    In this one, I don't think app has any property called services. Maybe you need to do something like this

    const mongodb = app.currentUser.mongoClient("mongode-atlas");
    

    Haven't actually tried this myself, just stitching together things I find that look like they make sense.

    The next line

    const collection = mongo.db("ServerDB").collection("UserAccounts");
    

    I think should be

    const collection = mongodb.db("ServerDB").collection("UserAccounts");
    

    Maybe that won't blow up, but it is still not doing anything useful, just getting some objects.

    Next you can try with

    collection.updateOne({ $set: { myNewProperty: "foo" } })
    .then(() =>
    {
     // Refresh the user's local customData property
     return app.currentUser.refreshCustomData()
    })
    .then(() =>
    {
     // try to console.log the custom data here to see if something changed
    });
    
    

    After doing this also check the database, to see if that was updated.

    I don't think I can help anymore without actually working on this :P

  • Just one more thing I noticed reading the documentation.

    mongodb.com/docs/atlas/device-sdks/web/access-custom-user-data

    There is a warning about stale data.

    So you might want to try doing

    await app.currentUser.refreshCustomData();
    

    before getting the custom data to make sure you are getting the latest available.

  • It's hard to tell without looking at your project.

    If you take the example and just change the GetDate function to return Date.Get(2021, 11, 12, 19, 0, 0, 0), the count down works as expected. So I imagine that in the process of copying and pasting you maybe forgot something or there is something that needs to be changed and you missed it.

    The parameters for the Date.Get expression are as follows:

    year => 4 digit number
    month => 0 to 11
    day => 1 to 31
    hour => 0 to 23
    minutes => 0 to 59
    seconds => 0 to 59
    milliseconds => 0 to 999
    

    So Date.Get(2021, 11, 12, 19, 0, 0, 0) should get you the date for December 12th 2021 at 7pm

  • It seems you need to enable custom user data before you are able to use it.

    mongodb.com/docs/atlas/app-services/users/custom-metadata

  • Is this how you are setting the custom data?

    mongodb.com/docs/atlas/device-sdks/web/access-custom-user-data

    I would try doing it that way, and then see if retrieving it works. There is a note about write permissions, which I am not too sure what it means, but it might be worth to keep it in mind if you can't write the data.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • What have you tried doing to set the custom data?

    I am not very familiar with the library, but if it is returning an empty object, then it is likely nothing was set to begin with.

  • Look for the Date & time example in the start page of C3. Just type Date & time in the search box and you should find it.

    The example shows a bunch of things you can do with the Date plugin. Calculating the time between the current date and a future date is one of them.

    There are quite a few things going on in the example, so just ask again if there is something you don't understand after taking a look.

  • Here is an example showing how you could do it.

    dropbox.com/scl/fi/zo926qwwepyn2a5hyckbw/DrawingCanvasCanvasJS.c3p

    The script creates an element for the library to use and makes sure it is hidden. Then sends it to the library, does the rendering and finally extracts the results from it's "canvas" property into the drawing canvas plugin instance.

    There is a little caveat to the whole process though. The drawing canvas is not available for use through the scripting API until at least 1 tick has passed, so the script in the example makes sure to wait for that.

    Hopefully we will sort that out sometime in the near future, but until then you'll have to do with the little hack.

  • There aren't any plans to implement this.

    When the feature was first introduced we thought that we would consider implementing moving along a bezier curve if there was an interest in the feature.

    As far as I am aware it has never been mentioned on the forums or the suggestions platform.

  • eleanorjmorel

    As with any other bug, the best you can do to report it, is to come up with the smallest project that reproduces the bug.

    Just from looking at the video I really can't tell that anything is wrong at at all.

  • No. It updates a WebGL texture dynamically, which while much faster than drawing to a canvas and then creating a new texture from that... we don't get to use any of the built in features of a canvas.

  • This actually is more difficult than it seems.

    It's one of those features that is taken for granted, but when it turns out you have to implement it... well... it's more difficult than you initially thought.

    And that is the case here, we can not take advantage of an existing browser feature and just hook it up to C3, instead it has to be an implementation of our own.

  • You can set a layer to be global, it's a dropdown in the properties of a layer in the properties bar.

    After setting the layer to be global, go to another layout, create a new layer in it and give it the same as the global layer you set previously.

    After doing all of that, the new layer will have the same content as the original global layer. This can be repeated in as many layouts as needed.