Can someone write something which broadcasts the text "command-[methodname]" whenever a block is evaluated?
Offline
Got it!
It's a two-line patch, so I'll just dictate it to you.
Navigate to Scratch-Blocks > CommandBlockMorph (instance) > evaluation > evaluateWithArgs:
Declare the variable "stage" at the top.
After the special cases section, so before the very last line of code, add the following:
(stage _ self receiver ownerThatIsA: ScratchStageMorph).
stage broadcast: self selector.
It might not be the best way, but it's definitely the quickest
Last edited by LS97 (2012-02-10 06:19:41)
Offline
Oh, the code above only broadcasts the selector. If you want it to broadcast the 'command-' bit too, just concatenate it with a comma.
Offline
LS97 wrote:
Got it!
It's a two-line patch, so I'll just dictate it to you.
Navigate to Scratch-Blocks > CommandBlockMorph (instance) > evaluation > evaluateWithArgs:
Declare the variable "stage" at the top.
After the special cases section, so before the very last line of code, add the following:(stage _ self receiver ownerThatIsA: ScratchStageMorph).
stage broadcast: self selector.It might not be the best way, but it's definitely the quickest
![]()
*jaw drops*
How can you amaze me with perfect solutions every time?
Thanks!
Offline
Hardmath123 wrote:
*jaw drops*
How can you amaze me with perfect solutions every time?
Thanks!![]()
Experience
I did spend quite a bit of time developing Bingo, so I got accustomed with Squeak. Now these challenges are actually quite fun
Offline
sparks wrote:
MathWizz wrote:
Why do you need this? It seems like and odd thing to broadcast.
![]()
My guess? He's working on a language within Scratch and is using broadcasts to trigger different blocks...
Nah, something for my iOS to Scratch connector.
Offline
LS97 wrote:
Hardmath123 wrote:
*jaw drops*
How can you amaze me with perfect solutions every time?
Thanks!![]()
Experience
![]()
I did spend quite a bit of time developing Bingo, so I got accustomed with Squeak. Now these challenges are actually quite fun![]()
I have no idea how much Squeak I know....
I just know my understanding of it is raising each time I develop Kitcat.
Offline