This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2010-07-13 22:39:47

Jwosty
Scratcher
Registered: 2009-12-19
Posts: 500+

Disable 'Show on Stage' Toggle

I need to disable the show on stage toggle, while having just one argument for the block in question. As you know, there are other blocks in Scratch that do this. Thanks for reading!  smile


http://i39.tinypic.com/18ert5.png Google it.  smile

Offline

 

#2 2010-07-13 23:06:38

Sunrise-Moon
Scratcher
Registered: 2009-06-27
Posts: 1000+

Re: Disable 'Show on Stage' Toggle

So you mean you want to hide your sprite and only use one script? Just put make a variable that hides the sprite when it is equal to one, and then make a new if that shows it if the variable is equal to 0.


http://i1067.photobucket.com/albums/u427/HulKDzN/RebornBlade.png

Offline

 

#3 2010-07-14 06:31:05

ScratchReallyROCKS
Scratcher
Registered: 2009-04-22
Posts: 1000+

Re: Disable 'Show on Stage' Toggle

Sunrise-Moon wrote:

So you mean you want to hide your sprite and only use one script? Just put make a variable that hides the sprite when it is equal to one, and then make a new if that shows it if the variable is equal to 0.

No, he means he wants to disable the checkbox near a custom block with an input so it's watcher doesn't say (sprite1's %s [     ]) or something like that.


http://imageshack.us/a/img694/3806/sigmad.png

Offline

 

#4 2010-07-14 12:15:29

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: Disable 'Show on Stage' Toggle

It's all in CommandBlockMorph's #canBecomeWatcher

It does both tests for sections of messages (good if all the blocks in a category shoudn't be shown) and individual messages. I have a fix somewhere that replaces the %'s in the strings with the actual parameters, though. If you want it, ask me and I'll dig it out  smile

Last edited by nXIII (2010-07-14 12:17:04)


nXIII

Offline

 

#5 2010-07-18 00:21:04

Jwosty
Scratcher
Registered: 2009-12-19
Posts: 500+

Re: Disable 'Show on Stage' Toggle

Actually, what I meant is do disable watchers for a specific custom block I made.


http://i39.tinypic.com/18ert5.png Google it.  smile

Offline

 

#6 2010-07-20 15:34:43

Jwosty
Scratcher
Registered: 2009-12-19
Posts: 500+

Re: Disable 'Show on Stage' Toggle

Bump.


http://i39.tinypic.com/18ert5.png Google it.  smile

Offline

 

#7 2010-07-20 15:44:31

ScratchReallyROCKS
Scratcher
Registered: 2009-04-22
Posts: 1000+

Re: Disable 'Show on Stage' Toggle

Jwosty wrote:

Actually, what I meant is do disable watchers for a specific custom block I made.

I think the only way to do that is to have more than one argument in it.


http://imageshack.us/a/img694/3806/sigmad.png

Offline

 

#8 2010-07-20 16:05:14

MathWizz
Scratcher
Registered: 2009-08-31
Posts: 1000+

Re: Disable 'Show on Stage' Toggle

Lol! Did any of you read nXIII's post?


http://block.site90.net/scratch.mit/text.php?size=30&text=%20A%20signature!&color=333333

Offline

 

#9 2010-07-21 19:17:37

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: Disable 'Show on Stage' Toggle

MathWizz wrote:

Lol! Did any of you read nXIII's post?

I did!  big_smile


nXIII

Offline

 

#10 2010-07-24 16:43:14

Jwosty
Scratcher
Registered: 2009-12-19
Posts: 500+

Re: Disable 'Show on Stage' Toggle

nXIII wrote:

It's all in CommandBlockMorph's #canBecomeWatcher

It does both tests for sections of messages (good if all the blocks in a category shoudn't be shown) and individual messages. I have a fix somewhere that replaces the %'s in the strings with the actual parameters, though. If you want it, ask me and I'll dig it out  smile

Oh, thanks! (I didn't seem to see that first part) I'll see if it works!  lol

Last edited by Jwosty (2010-07-24 16:43:40)


http://i39.tinypic.com/18ert5.png Google it.  smile

Offline

 

#11 2010-07-24 17:01:18

Jwosty
Scratcher
Registered: 2009-12-19
Posts: 500+

Re: Disable 'Show on Stage' Toggle

It didn't work when I changed the method to this:

canBecomeWatcher
    "I determine which blocks can become watchers."

   

Code:

canBecomeWatcher
    "I determine which blocks can become watchers."

    | i |
    i _ selector asString findAnySubStr: #('mouse' 'key' 'touching' 'distance' 'now') startingAt: 1.
    ^ (self isReporter) &
       (self argumentCount <= 1) &
       ((#(not atRandom abs rounded lineCountOfList: stringLength:) includes: selector) not) &
       (i > selector asString size)

(The block was called '[day index] now' with a drop down menu)

Help?

Last edited by Jwosty (2010-07-24 17:01:59)


http://i39.tinypic.com/18ert5.png Google it.  smile

Offline

 

#12 2010-07-26 11:40:11

bigreader
Scratcher
Registered: 2007-08-14
Posts: 100+

Re: Disable 'Show on Stage' Toggle

Jwosty wrote:

It didn't work when I changed the method to this:

canBecomeWatcher
    "I determine which blocks can become watchers."

   

Code:

canBecomeWatcher
    "I determine which blocks can become watchers."

    | i |
    i _ selector asString findAnySubStr: #('mouse' 'key' 'touching' 'distance' 'now') startingAt: 1.
    ^ (self isReporter) &
       (self argumentCount <= 1) &
       ((#(not atRandom abs rounded lineCountOfList: stringLength:) includes: selector) not) &
       (i > selector asString size)

(The block was called '[day index] now' with a drop down menu)

Help?

What was the method of the block? (the "#methodName:Here" part) That's what you need to put in the brackets. Odd, but apparently that's how it works.  smile


I'm currently taking a break from Scratch.
Zing - now even easier to install!

Offline

 

#13 2010-07-27 19:42:09

Jwosty
Scratcher
Registered: 2009-12-19
Posts: 500+

Re: Disable 'Show on Stage' Toggle

I don't know what #metodNameHere part you are talking about...

So, here is the 'blockSpecs' part:

Code:

('%t now'                        r    dateTime: 'day index')

This is the 'dateTime part:

Code:

dateTime: itemName
    "returns the date or time selection from a menu"

    | hour |
    "date"

    'year'        = itemName ifTrue: [^ Date today year].
    'month'        = itemName ifTrue: [^ Date today monthName].
    'day index'        = itemName ifTrue: [^ Date today day].
    'full date'    = itemName ifTrue: [^ Date today].
    'weekday'    = itemName ifTrue: [^ Date today weekday].

    "time"

    'hour'        = itemName ifTrue: [(Time now hours > 12) ifTrue:
                                                            [ hour:= (Time now hours - 12)]
                                                       ifFalse:
                                                            [ hour:= Time now hours]. ^ hour.].
    'minute'    = itemName ifTrue: [^ Time now minutes].
    'second'        = itemName ifTrue: [^ Time now seconds].

    ^42

dateFunctionNames:

Code:

dateFunctionNames
    "Answer a collection of date names."

    ^ #(
        'year'
        'month'
        'day index'
        'full date'
        'weekday'
        'hour'
        'minute'
        'second' )

And finally, the unColoredArgMorphFor: aString (Just the part with my dateTime menu):

Code:

$t = code ifTrue: [^ ChoiceArgMorph new getOptionsSelector: #dateFunctionNames; choice: 'day index'].

Thanks!  wink


http://i39.tinypic.com/18ert5.png Google it.  smile

Offline

 

#14 2010-07-29 14:31:39

bigreader
Scratcher
Registered: 2007-08-14
Posts: 100+

Re: Disable 'Show on Stage' Toggle

Jwosty wrote:

I don't know what #metodNameHere part you are talking about...

So, here is the 'blockSpecs' part:

Code:

('%t now'                        r    dateTime: 'day index')

This is the 'dateTime part: ... Thanks!  wink

Are you using the source code or Scratch?

If you're using Scratch, put this part ('%t now' #- #dateTime) in the brackets.

If you're using the source code, I don't know what to do at the moment -- let me open up my ancient copy of it and have a look around.  smile


I'm currently taking a break from Scratch.
Zing - now even easier to install!

Offline

 

#15 2010-07-29 16:12:31

Jwosty
Scratcher
Registered: 2009-12-19
Posts: 500+

Re: Disable 'Show on Stage' Toggle

I'm using the source... But I hope we figure this out!  tongue


http://i39.tinypic.com/18ert5.png Google it.  smile

Offline

 

#16 2010-07-30 16:21:24

Jwosty
Scratcher
Registered: 2009-12-19
Posts: 500+

Re: Disable 'Show on Stage' Toggle

Bump?


http://i39.tinypic.com/18ert5.png Google it.  smile

Offline

 

#17 2010-08-01 11:17:08

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: Disable 'Show on Stage' Toggle

You need to use part of the selector, not the block spec, so search for date or something.


nXIII

Offline

 

#18 2010-08-02 11:33:14

Jwosty
Scratcher
Registered: 2009-12-19
Posts: 500+

Re: Disable 'Show on Stage' Toggle

Sorry, I don't know what you mean. Could you explain a little more? I can't beleve I forgot what selector means!  yikes


http://i39.tinypic.com/18ert5.png Google it.  smile

Offline

 

#19 2010-08-02 20:13:43

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: Disable 'Show on Stage' Toggle

selector is the "name" of the message, like "indexOf:" or "dateTime:"


nXIII

Offline

 

#20 2010-08-03 11:10:55

Jwosty
Scratcher
Registered: 2009-12-19
Posts: 500+

Re: Disable 'Show on Stage' Toggle

But wait... I tried 'now' also.


http://i39.tinypic.com/18ert5.png Google it.  smile

Offline

 

#21 2010-08-03 18:15:31

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: Disable 'Show on Stage' Toggle

It would be 'date' or 'Time' (parts of "dateTime:"


nXIII

Offline

 

#22 2010-08-03 19:38:33

Jwosty
Scratcher
Registered: 2009-12-19
Posts: 500+

Re: Disable 'Show on Stage' Toggle

Thanks so much! It worked!  lol


http://i39.tinypic.com/18ert5.png Google it.  smile

Offline

 

#23 2011-01-24 12:10:59

comp500
Scratcher
Registered: 2010-01-08
Posts: 1000+

Re: Disable 'Show on Stage' Toggle

Thanks a lot!!!!


800 posts! W00T! Oh sorry im not on a lot but at least i have 1000+ posts

Offline

 

Board footer