Bl4ckSh33p's Forum Posts

    Thank you very much for your example KYATRIC. It's working now.

    Maybe I should not try to code when I need to take strong antibiotics. It sometimes makes your brain silly.

  • Hi. I tried to create a countdown which shows remaining hours:minutes:seconds but have some issues with times longer than 24 hours (and if I add minutes a hour is added). You can find it here:

    /Update: Fixed.

  • Debugger shows about 25-30% CPU utilisation in a new project with just 2 sprites.

  • You could try the built in shake. Just add the "Scroll to" behavior and then call its shake action.

  • A built in function for it would be nice. Until then the plugin can be found here:

    I just tried a few things with the system time and it seems to work if you just subtract the destination time (current+entered amount for the countdown) from the current system time.

    The code:

    It displays a 5 Minute countdown counting down every second.

    /Update: Seems it does not work as expected. I added 10.000 to CurrentUnixTime (should be 10 seconds when the Unix Time is in Milliseconds?) but my Countdown shows an additional hour and adding 1 day shows 0 instead of 24 hours (only uses 0-24 for a single day and cant display more like 36 hours?)

    Any ideas how to fix this?

    Hi! I am looking for somthing similar.

    I installed the System Time Plugin () and I want to show a custom countdown.

    The User has 3 input fields. One for Days, Hours and Minutes. So if you enter 1 Day, 12 Hours it should display a Countdown counting down the entered amount of time.

    But it should work even if you close the app for a while and reopen it a few hours later (thats why you need the plugin).

    So if you launch a timer you need to get the current system time (I used the unix format) and then add the entered Amount of time and store it. And every x Seconds (or whenever you want to refresh your countdown timer) it should show the remaining time. Did anyone already create something like this or know a good/easy way to do this?

  • This will be very useful for my new project. Thank you very much.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi. I tried to reproduce it in a new very simple project but it worked there.

    I tried to add "On Image URL Loaded" to my existing code but it did not work with the For-loop (and you cant put it inside/below the loop) so I created this workaround and just changed the sprite size depending on the first letter in the filename (1 for 100 pixel, 2 for 200 pixel) and it seems to work now.

  • But when I add a "On Image URL loaded" (triggers once after loading an image) event and set a variable containing Sprite.ImageHeight it returns 0. o.O

  • Thank you very much! I changed the animation image in the for-loop and set it to loopindex and it works.

    But I have some problems getting the image/sprite height after loading an image. It seems it is not updated properly after loading a image from URL.

    Did you ever use Sprite.Height or .ImageHeigt after loading an image?

    After many tries I were not able to get the proper values so I reported it (may be a bug):

  • Problem Description

    After loading an external image into a sprite with the option set to resize the sprite to image size you cant get Sprite.Height and Sprite.ImageHeight.

    When I output the Sprite.Height it always shows the default value of 177, but all loaded images have sizes of 100, 200 or more pixels.

    When I output the Sprite.ImageHeight it always shows 100 even if the loaded image has 200 or more pixels (can't find the reason for this).

    The images have this sizes: 1.jpg 100x100 pixel, 2.jpg 100x100 pixel, 3.jpg 100x200 pixel, 4.jpg was a huge screenshot to see if size changes.

    The animated sprites seem to resize properly, the screenshot was not streched but Sprite.Height returns 177 (the default value of the TempSprite object placed outside of the layout).

    Attach a Capx

    Attached

    Description of Capx

    It loads a banner.txt file containing a list of filenames like 1.jpg|2.jpg|3.jpg... and then creates a loop to create a new sprite for each image.

    To be able to position them depending on their height I used a second sprite object (TempSprite) to load the image first and then use Sprite.Height / Sprite.ImageHeight in the Create Sprite action. All Sprites should move from top to bottom with 10px space between them and wrap around at the end (wrap behavior does not seem to work properly if youc reate sprites outside of the layout so I used my own code with position check)

    I installed XAMPP (local Apache Server) to test it on localhost. Don't know how to change it so you can reproduce it easily.

    relevant code starts in line 19

    Observed Result

    Sprite.Height and Sprite.ImageHeigt of the TempSprite object is always the same value even if the loaded images have different sizes.

    Expected Result

    Since "Resize to Image Size" is set in the Load from URL action it should change the sprite size and the new size should be returned.

    Affected Browsers

    • Chrome: YES
    • FireFox: Don't know
    • Internet Explorer: YES

    Operating System and Service Pack

    Windows 8.1 64 Bit

    Construct 2 Version ID

    r166

  • Seems I found it in the closed bugs section:

    But is it possible to add new frames on runtime and load a different image for all frames for a sprite object and then set the shown frame for each object?

    I cant test it right now because I don't have access to C2 here.

  • Hi. Seems I encountered the same problem here:

    So a for-loop picking separate instances of a sprite will not work and even if you pick a single instance all sprites will load the new image, right?

    I tried to load external images for all sprites so the user can customize it.

    Is it possible to add new frames on runtime and load a different image for all frames for a sprite object and then set the shown frame for each object?

  • I am not sure, but it could be a bug since all other actions I tried seem to work different and "pick" the last created object as target.

    It would be much easier (for my needs in this project) if it would just work like the other actions and change the image of the last created sprite. Did anyone else have problems with this?

    Maybe I can add an Instance Variable with the image url/filename and create another "for x=1, numSprites" loop and then change the image of the sprites? I will test this when I have more time this evening. But I am not very experienced with picking objects, yet.