angellondon's Recent Forum Activity

  • I'm having a little trouble implementing this into my app; wondered if anyone could lend me a hand?

    Capx is here: https://www.dropbox.com/s/lb3t6wxr7jpzye1/save_canvas.zip

    Live demo is here: http://www.angelserver.in/html5/save_canvas/

    (This is a functionality-only version by the way! It is ugly as hell.)

    First click 'use webcam', then hit the 'snap' button to capture your face in the frame.

    Then hit save canvas, which supposedly saves a screenshot between points 1 and 2 (marked on live demo).

    Then hit show image, which is supposed to load the resultant screenshot in a new tab, for saving.

    Event sheet is below:

    What currently happens upon clicking save is a new tab is opened, and a "Not Found. The requested document was not found on this server." error occurs. This would lead me to believe that something is going wrong at the saving stage, but I can't quite figure out what. Where is the .png being saved? This is something that wasn't clear to me when I followed the original example.

    Any help would be appreciated to shed some light on this. Thank you.

  • I'm having a little trouble implementing this plugin: plugin-c2i-canvas-base64-screenshot-to-image_t68493

    I want the user to be able to save out an image that is saved from a specific part of the canvas, rather than just screenshotting and downloading the entire canvas.

    Capx is here: https://www.dropbox.com/s/lb3t6wxr7jpzye1/save_canvas.zip

    Live demo is here: http://www.angelserver.in/html5/save_canvas/

    First click 'use webcam', then hit the 'snap' button to capture your face in the frame.

    Then hit save canvas, which supposedly saves a screenshot between points 1 and 2 (marked on live demo).

    Then hit show image, which is supposed to load the resultant screenshot in a new tab, for saving.

    Event sheet is below:

    Pretty sure I'm doing something wrong, but I've tried many variations and am having trouble figuring out what <img src="{SMILIES_PATH}/icon_e_sad.gif" alt=":(" title="Sad"> any help would be appreciated to shed some light on this. Thank you.

  • Just a lil' bump^ as it started to get buried in page 2 thanks guys.

  • For the mirrored sprite upon hitting an angle, this ought to work:

    For the pickupable gun and the menu, those are two separate things

    One approach just to get the simple pickup/gun fire working might be to:

    • Create a Global Variable 'PlayerHasGun1' or something similarly named
    • When Player collides with the gun sprite in the game, set this Global Variable to true
    • Destroy the gun sprite they collided with
    • Spawn a new gun sprite at a particular Image Point attached to your player sprite so that it moves around with the player
    • Make an event which says something like "if 'PlayerHasGun1' = true, when player presses (fire key), spawn bullet with acceleration 50 at image point 2 on the gun sprite
    • (Note: you also need to create separate events to check for any bullet collisions with enemies, and if collision is detected, destroy them)

    If you are going to have several types of guns, it may be worth having an array instead. Then you can look up certain positions in the array in order to see whether or not the player has that gun currently available.

    On that note, for the menu and gun selection, I would...

    • Create a global variable 'CurrentlySelectedGun' or something similar
    • Create a new layout before your game just for the gun selection.
    • Set up your sprites with an 'active' animation (gun available) and an 'inactive' animation (gun not available)
    • On the start of the layout, have the game check your gun array/global variables to see which guns the player has
    • Then you can set the sprite animation to either the 'active'/'inactive' animation dependent on which they have unlocked.
    • You can also then disable those sprites as clickable or not clickable (enabled/disabled) according to whether they've unlocked them
    • Then once a player clicks on a particular gun, you can set the global variable 'CurrentlySelectedGun' to whichever gun they chose and tell it to go to the game layout
    • At the start of the game layout, have the game check the value of 'CurrentlySelectedGun' and spawn the correct gun at an image point attached to the player according to which they have selected

    ...It sounds complicated, but actually, working your way through this you'll pick up a lot of the basics you'll need to complete the rest of the game if you get stuck I can try to make a quick .capx prototype for you to follow.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Either to crop it, or to 'mask' the rest of the image that you don't need, like you would in Photoshop/Illustrator/Flash?

    The broad context is a little mugshot generator thing for a client. A bit like the BBC America "Copper" mugshot thing from a few years ago. They used facial recognition tech in theirs to pick out the eyes, nose and mouth (results from their app were fantastic, check it out here: http://www.pinterest.com/svarland/copper-mugshots/) but that is a bit advanced for the purpose of this app <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

    I'd just like to be able to crop out a section of the face in order to better blend it in with the background - an image of a "criminal" posing with their name board.

    Prototype here (rough as hell <img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing"> ; example expanded on from C2 example project): http://www.angelserver.in/html5/webcam_test3

    I currently just paste another copy of the background image with a hole in the face onto the UserMedia object, and another layer beneath it with the background, but I think I can achieve a better result with cropping or masking if that sort of functionality exists. I'd like to use a mask a bit like this:

    Possible? <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy">

  • Thank you!

  • Yes Ive noticed that Candy Box and A Dark Room often seem to be spoken of in the same sentence. Many people say the two are similar and they enjoyed both. I am currently playing Candy Box 2 to get feel for what that game is all about.

    Awesome! Hope you enjoy it. I haven't played Candy Box 2 yet.

    Thanks for those general pointers. I am very new to C2 so any general advice like that is appreciated.

    Yes I totally intend to have a go at this and see what I can come up with. Soon Ill have time to sit down with C2 and put a couple of solid days into learning how to use it. Just madly trying to close out some client work first.

    You're welcome! Sorry for being a bit vague with my general advice. If I do mess about with it myself, I will upload my .capx so you can see how I try to handle it.

    I am also fairly new to C2, but about 2 months in I feel fairly confident with a lot of it already I have much more to learn, though.

  • Hi rexraibow,

    The link is still broken!

  • Ouch, same as me... okay. At this rate, I think I may try to tackle the issue slightly differently and save the contents to an image file instead of printing, and hope that I don't run into any further compatibility issues.

    Thank you for all your help.

  • Not sure if it's best practice, but I did it this way.

  • Just in case you need it, I got it to work in your .capx with:

  • Just disabled everything, and it doesn't seem to be this either

    I just got my colleague to test it out as well and it mirrored my experience -worked in Chrome, not in Firefox.

    ...To add insult to injury, I just tested it in Internet Explorer and it worked lol.

angellondon's avatar

angellondon

Member since 3 Jun, 2014

None one is following angellondon yet!

Connect with angellondon

Trophy Case

  • 10-Year Club
  • Email Verified

Progress

11/44
How to earn trophies