In this project, i show you my new block : Paste on sprite with effect.
(At the time of publishing this message, I noticed that @joecooldoo did approximately the same block in April. I'm still posting!)
In this project, i show you my new block : Paste on sprite with effect.
(At the time of publishing this message, I noticed that @joecooldoo did approximately the same block in April. I'm still posting!)
Very cute!
One little bug: If the pen is down when you use that block, it will leave a line between the sprite and the origin. For example, I put a PEN DOWN before the SAY [I WILL USE THIS BLOCK] near the beginning of the green flag script. When you call your block, the line appears. So, after saving the state of the sprite, do a PEN UP.
Speaking of saving state, at first I was wondering why you used those ugly sprite variables instead of using script variables, but I realized it's because you do the actual saving and restoring in (separate) subprocedures of your block.
That should be fixable with metaprogramming. I wrote this:
to use this way:
(and the RESTORE block doesn't have to delete the variables). But I can't get it to work. It seems to make the script variables, but I can't put values in them and I can't make watchers for them. I vaguely recall that there's some issue about script variables in the Variables library. But I'm frustrated that whenever I try to use metaprogramming, it fails. I'm sure that's because I'm doing something wrong, but if I can't understand how to do it, what hope do users have?
Anyway, if you or someone can make this work, that'd be awesome!
Corrected: Thank's
(save and restore)
Oh, there are 2 old blocks (1-2 years)... I didn't dive again into it.
What about someting like this (block var):
I like, they're cool and very useful, especially if we need to stamp to sprites by colour.
Yeah, that's not bad. I'm still frustrated that I couldn't get my way to work.
In a perfect world you'd be able to say
But I guess the official right way to do this is with roll your own OOP variables:
EDIT: Or even simpler, combine the making with the saving:
I'm trying to save the variables two callers up (SAVE _ AS _ called from SAVE ALL SPRITE PROPERTIES called from PASTE ON WITH EFFECTS, so that the eventual RESTORE can find them). Does that work for you?
Huh. I wonder what I did wrong. I'll try again I guess...