zhpeh's Forum Posts

  • 15 posts
  • What if the number of empty frames cannot be pre-determined in advance? Based on your example, it only displays 1 sprite per "page" and the no. of sprite is pre-determined.

    However, I would like to display more items (e.g. 6 column layout), and if there are more than 6 items, then it will display the navigation arrows for the user to scroll to view all the items. Otherwise, it will not have any arrows in the first place (or clicking the arrows will not have any effect).

  • Thanks a lot for sharing your demo!

    Based on your demo, the images are already pre-loaded in the game. Is there a way for me to dynamically populate the items via an AJAX call instead, while still having the scrolling feature?

  • Hi,

    I would like to create a horizontal scroll menu (1 row, X columns) where the user is able to either click on left/right arrows to navigate, or drag a scrolling bar to view the items within the menu.

    How can I achieve this?

  • Thanks for the suggestion. I've finally manage to make it work!

    Issue lied on my PHP API end rather than construct, had to perform the following string replacement in order for the base64 decoding to work.

    $image = $request->image;

    $image = str_replace('data:image/png;base64,', '', $image);

    $image = str_replace(' ', '+', $image);

    Appreciate your help!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I don't think that is the issue as the BinaryDate.GetBase64 only passes the actual Base64 string without the headers...

    Here's a screenshot for your reference:

    Did I miss any step?

  • I have a game that comprises of numerous sprites (about 10 per layout), each sprite comprising of many different frames (up to 300).

    When the game starts, it directs the user to the welcome layout (this loads very fast as there is only 1 button in the welcome screen).

    However, when the player clicks on the start button, it takes a much longer time to transit from the welcome layout to the home layout (about 2-3 seconds).

    Is there a way where I can achieve either of these:

    1. Pre-load all layouts (before welcome layout) so that user only has to wait once before the game starts

    2. Speed up the loading between layouts (or add a loading transition between the changing of layouts)?

    Reducing the no. of frames and sprites is not an option. I have already minimized the image sizes to be small (in KBs).

  • Thanks for sharing the threads! Managed to achieve what I want :)

  • Apologies, not sure why my uploaded image didn't get posted.

    I have managed to post BinaryData.GetBase64 to my desired API endpoint. However, when I try to store it into a .png file, it gives me a blank image and I'm not sure why. Is there something wrong with my System Snapshot Canvas?

    Thanks for sharing the documentation, I will try and see if I'm able to take a subset of the canvas area.

  • I'm trying to pass dynamic variable to C3 game that is embedded within a html webpage (built upon a PHP framework). However, I can't seem to access the LocalStorage variable when the game loads even after I have performed the following:

    On Start of Layout - LocalStorage check if item exists

    LocalStorage - On Item exists: Access LocalStorage.ItemValue

    However, this doesn't seem to be working and I can't seem to retrieve the LocalStorage variable that I am trying to access.

    Appreciate if anyone can guide me on this!

  • Here's a screenshot of what I have done:

    Am I right to send an AJAX POST request after "AJAX Request URL" to my endpoint?

    I don't quite understand why I have to perform "AJAX Request URL" after "AJAX Set Binary Response". Can't I just obtain the data from BinaryData?

    Also, do you know how I might be able to take a snapshot of a portion of the game screen (specific x and y coordinates) instead of the whole screen?

  • dop2000 Thanks for the suggestion. What do you mean by the 2nd line? Do you mean to perform an AJAX POST request? I tried to perform a POST Binary to URL to my API endpoint, but it doesn't seem to be working.

  • Instead of invoking the downloading of CanvasSnapshot, I'm trying to store the captured snapshot into an object (e.g. binary data) and then posting the data (e.g base64 format) to an external API endpoint.

    Is there a way that I can do this within Construct 3? Appreciate any help!

  • dop2000 Thanks for the example, I managed to get it to work!

  • dop2000 Thanks for the clarification. Is there any way I can loop through an array of objects in Construct?

  • I'm performing an AJAX request with a data structure of the following:

    [ c2array: true, size:

    [3,9,1],

    data: [ { key1: val1, key2: val2, key3: val3, key4: val4, key5: val5, }, { key1: val1, key2: val2, key3: val3, key4: val4, key5: val5, }, { key1: val1, key2: val2, key3: val3, key4: val4, key5: val5, }, ]

    When I try to store the results of the AJAX request using AJAX.LastData into an array, I get [object Object] as its values.

    How can I loop through each key of the object to access its value? Appreciate any help here.

  • 15 posts