Drawing Text - How to specify when to draw?

HidetoKoudanshi

  • Posts: 127
I don't understand the "When drawing" feature whatsoever. How do I cause text to appear when my game loads or when I click on an actor? "When drawing" can't be called inside of a "When created" block and that makes no sense and feels dumb. How do I do this? I spent an hour scouring the Stencylpedia and anything else I could find, so I definitely made an effort to learn this by myself but I simply can't.

Please help? If you want to know what I'm trying to achieve, I want to save and load my game progress, and when the game is first opened and the saved data is loaded, I want to pop up a success message if it succeeds or an error message if it fails. How do I do that?
If I ever commission you for code work, please know that I understand how commissioning works. You must get paid first before you will code anything for me. Only once you are paid the agreed-upon price, will you begin coding for me. I respect artists and coders. You deserve to be paid for your hard efforts.

Luyren

  • *
  • Posts: 2812
https://youtu.be/diMrZg95Oqw
This video explains in-depth how to use the drawing blocks.
My Stencyl resources are available here: https://luyren.itch.io/
Cutscenes, RPG Elements, Particles, Map System and many more.

HidetoKoudanshi

  • Posts: 127
I really appreciate your information and I watched the video but it went by so quickly that I wasn't really able to pick up on it.

I don't understand the custom attribute you had to build to trigger the When Drawing block. And what if I want multiple When Drawing blocks that have different text? How do I make sure to call only the one I need for the input method or actor state that I'm using?

I'm trying to make it so that when you click on an actor designed as a button, it causes text to appear next to the button, like a counter. Every time you click the button, +1 is added to a displayed number nearby. If the number is empty or 0, make a 1. If there's already a number there, take that number and add +1 to it and display the result in that spot.
If I ever commission you for code work, please know that I understand how commissioning works. You must get paid first before you will code anything for me. Only once you are paid the agreed-upon price, will you begin coding for me. I respect artists and coders. You deserve to be paid for your hard efforts.

Luyren

  • *
  • Posts: 2812
Do you mean you don't understand attributes in general?
Here is the Stencylpedia article on attributes: https://www.stencyl.com/help/view/attributes/
Here is my video on attributes: https://youtu.be/R7CB7xwoLyo

I mentioned in the "Basics" part of the video near the beginning that When Drawing executes every visual frame. At 60 fps, that's 60 times per second.
Use only one When Drawing event per behavior.
Use more text drawing blocks if you want more text or more drawings.
Use if blocks with the appropriate conditions to limit which ones are drawing.
In the case of your button, draw the attribute for your counter.

And regarding the speed of the first video, you can pause it, rewind it and watch as many times as you need. I cannot do more than that.
My Stencyl resources are available here: https://luyren.itch.io/
Cutscenes, RPG Elements, Particles, Map System and many more.

HidetoKoudanshi

  • Posts: 127
Thanks for your reply. I'll do my best with it. I appreciate the time and effort you spent. :)
If I ever commission you for code work, please know that I understand how commissioning works. You must get paid first before you will code anything for me. Only once you are paid the agreed-upon price, will you begin coding for me. I respect artists and coders. You deserve to be paid for your hard efforts.