draw with a superimposition of PNG files

TEST POUR FORUM PROCESSING

Hello! I would like to know how I can make a code to get this kind of result. I imagine different lists of pictures, and each picture would appear instead of the mouse. If one presses "A", a kind of form would appear, if one presses B, another, etc...

  • the picture will be PNG file, with a transparent background.
  • they will appear randomly from a list ("A", "B", "C" or "D" files)
  • they will appear with a random rotation if it's possible
  • the picture would be fixed by the "mousePressed".
  • another picture will appear after the precedent one is fixed

So.. I made a little drawing on Illustrator, maybe you will understand my idea more. My problem is that I don't know how to search the different parts of the code on the internet, the key words and all.

Thank you very much for your help!!! ;)

Answers

  • Which part are you stuck on?

    The best thing you can do is break your problem down into smaller steps and take those steps on one at a time.

    For example, can you create a simple sketch that shows a single image? Work your way forward from there. Can you only show the image after the user presses a particular key? Get that working, and then try to add a second image.

    Then if you get stuck, you can post a MCVE along with a more specific question. Good luck.

  • edited March 2018 Answer ✓

    @GeromineP --

    As KevinWorkman suggests, can you:

    1. make a sketch that shows a single image?
    2. make a sketch that simply draws two images on top of each other?
    3. make a sketch that, every time you click, draws one image where the mouse was?

    Once you are at this point, you should be ready to switch between different source images.

    Under the reference, look for Image command such as image() and mouse commands such as mouseClicked() and mousePressed(). If you haven't already understood the very basics of how to make a sketch with setup() and draw() do the tutorials first.

    To get started on your problem you might be interested in looking at related examples:

    such as:

  • Oh! Thank you very much! I'm going to try it like this, and I'll come back after that. :)

Sign In or Register to comment.