Discuss Scratch

Prinseskat
Scratcher
1000+ posts

If (sprite name) showing? block

<if (sprite name) showing?>
A boolean reporter saying whether or not a sprite is onscreen and you can see it. I'm not aware of a particularly easy workaround.
stickfiregames
Scratcher
1000+ posts

If (sprite name) showing? block

Why not just
<showing? :: looks>

We could also have a block like the current
([ v] of [ v])
but for booleans.

Last edited by stickfiregames (Dec. 2, 2014 08:35:37)

Prinseskat
Scratcher
1000+ posts

If (sprite name) showing? block

stickfiregames wrote:

Why not just
<showing? :: looks>

We could also have a block like the current
([ v] of [ v])
but for booleans.
Only
<showing? :: looks>
makes sense, I guess. How would the
([ v] of [ v])
block for booleans work/look though? (You can put booleans into the current block, though I don't think it'll work well.)

Last edited by Prinseskat (Dec. 2, 2014 09:03:14)

salvation_
Scratcher
100+ posts

If (sprite name) showing? block

The if shown block would be like this
if <shown?> then

end
This block could be used to find out if something is visible. Currently the only way to do this is to show a sprite that covers the whole screen, and then see if the sprite is touching that screen, and then hide the sprite that covers the whole screen. I am uncertain if this trick actually works. But if it does there is still a problem with this. The problem is that it when the project gets laggy it flashes the sprite making it visible and then invisible, so that half the time you can still see the sprite.
Morimop
Scratcher
1000+ posts

If (sprite name) showing? block

No Support.

show
set [shown? v] to [1]

hide
set [shown? v] to [0]

if <(shown?) = [1]> then
... :: grey
end
salvation_
Scratcher
100+ posts

If (sprite name) showing? block

Morimop wrote:

No Support.

show
set [shown? v] to [1]

hide
set [shown? v] to [0]

if <(shown?) = [1]> then
... :: grey
end
However if you have a lot of clones that wouldn't work for all of them. What if some clones are shown and some are not you would need this block!
Skywarslord
Scratcher
100+ posts

If (sprite name) showing? block

Support.It would make lot of projects eaiser to make without having to put Variables after every show/hide and make things genarlly eaiser.
Wisst_Cat
Scratcher
100+ posts

If (sprite name) showing? block

What are the uses for this? Are you looking for a specific use or many? If you're planning to use this in one project, do you think it can be used in other projects?
Morimop
Scratcher
1000+ posts

If (sprite name) showing? block

4dsfunk wrote:

salvation_ wrote:

Morimop wrote:

No Support.

show
set [shown? v] to [1]

hide
set [shown? v] to [0]

if <(shown?) = [1]> then
... :: grey
end
However if you have a lot of clones that wouldn't work for all of them. What if some clones are shown and some are not you would need this block!
Yea
Try to create a “sprite-only” variable and use broadcasts.
when I receive [is ... shown v]
if <(shown?) = [0]> then
... :: grey
end
salvation_
Scratcher
100+ posts

If (sprite name) showing? block

Wisst_Cat wrote:

What are the uses for this? Are you looking for a specific use or many? If you're planning to use this in one project, do you think it can be used in other projects?
Yes I want to use it in my game but it could also be useful for other people who are making similar projects.
salvation_
Scratcher
100+ posts

If (sprite name) showing? block

Morimop wrote:

4dsfunk wrote:

salvation_ wrote:

Morimop wrote:

No Support.

show
set [shown? v] to [1]

hide
set [shown? v] to [0]

if <(shown?) = [1]> then
... :: grey
end
However if you have a lot of clones that wouldn't work for all of them. What if some clones are shown and some are not you would need this block!
Yea
Try to create a “sprite-only” variable and use broadcasts.
when I receive [is ... shown v]
if <(shown?) = [0]> then
... :: grey
end
Yes but this would only work for the sprite who uses the shown variable not for the clones.
Vercte
Scratcher
500+ posts

If (sprite name) showing? block

salvation_ wrote:

everybody else wrote:

~snippity snip snip~
Yes but this would only work for the sprite who uses the shown variable not for the clones.
Actually, if you set it to sprite only, it DOES work for the clones. That's how you create a clone ID system.
salvation_
Scratcher
100+ posts

If (sprite name) showing? block

Vercte wrote:

salvation_ wrote:

everybody else wrote:

~snippity snip snip~
Yes but this would only work for the sprite who uses the shown variable not for the clones.
Actually, if you set it to sprite only, it DOES work for the clones. That's how you create a clone ID system.
How do you set it to sprite only is their a way to make the message only go to clones or only go to sprites. Because if so that would be great except I don't know how to use it!
Vercte
Scratcher
500+ posts

If (sprite name) showing? block

salvation_ wrote:

Vercte wrote:

salvation_ wrote:

everybody else wrote:

~snippity snip snip~
Yes but this would only work for the sprite who uses the shown variable not for the clones.
Actually, if you set it to sprite only, it DOES work for the clones. That's how you create a clone ID system.
How do you set it to sprite only is their a way to make the message only go to clones or only go to sprites. Because if so that would be great except I don't know how to use it!
This is how:

New Variable

o for all sprites o For this sprite only
^ click this, and it becomes personal to every clone!
Then,
when I start as a clone
hide
set [foo v] to [1]
if <(foo)=[1]> then
think [i am hidden]
end
salvation_
Scratcher
100+ posts

If (sprite name) showing? block

Vercte wrote:

salvation_ wrote:

Vercte wrote:

salvation_ wrote:

everybody else wrote:

~snippity snip snip~
Yes but this would only work for the sprite who uses the shown variable not for the clones.
Actually, if you set it to sprite only, it DOES work for the clones. That's how you create a clone ID system.
How do you set it to sprite only is their a way to make the message only go to clones or only go to sprites. Because if so that would be great except I don't know how to use it!
This is how:

New Variable

o for all sprites o For this sprite only
^ click this, and it becomes personal to every clone!
Then,
when I start as a clone
hide
set [foo v] to [1]
if <(foo)=[1]> then
think [i am hidden]
end
But that hides the clones what if you want the clones shown?
Vercte
Scratcher
500+ posts

If (sprite name) showing? block

It works the other way, just set it to zero.
Nambaseking01
Scratcher
1000+ posts

If (sprite name) showing? block

There is an older duplicate for this topic: https://scratch-mit-edu.ezproxyberklee.flo.org/discuss/topic/69728/

But since this topic contains more discussion, I'll report the two topics to be merged
coder2045
Scratcher
1000+ posts

If (sprite name) showing? block

define show
show
set [shown? v] to [1]

define hide
hide
set [shown? v] to [0]

<(shown?) = [1]>
Done.
salvation_
Scratcher
100+ posts

If (sprite name) showing? block

Nambaseking01 wrote:

There is an older duplicate for this topic: https://scratch-mit-edu.ezproxyberklee.flo.org/discuss/topic/69728/

But since this topic contains more discussion, I'll report the two topics to be merged
How do you report a topic to be a duplicate?
salvation_
Scratcher
100+ posts

If (sprite name) showing? block

coder2045 wrote:

define show
show
set [shown? v] to [1]

define hide
hide
set [shown? v] to [0]

<(shown?) = [1]>
Done.
Yes but if you have two sprites or multiple clones that wouldn't work!

Powered by DjangoBB