Discuss Scratch
- Prinseskat
-
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
-
1000+ posts
If (sprite name) showing? block
Why not just
We could also have a block like the current
<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
-
1000+ posts
If (sprite name) showing? block
Only Why not just<showing? :: looks>
We could also have a block like the current([ v] of [ v])but for booleans.
<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_
-
100+ posts
If (sprite name) showing? block
The if shown block would be like this
if <shown?> thenThis 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.
end
- Morimop
-
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_
-
100+ posts
If (sprite name) showing? block
No Support.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!show
set [shown? v] to [1]
hide
set [shown? v] to [0]
if <(shown?) = [1]> then
... :: grey
end
- Skywarslord
-
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
-
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
-
1000+ posts
If (sprite name) showing? block
Try to create a “sprite-only” variable and use broadcasts.YeaNo Support.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!show
set [shown? v] to [1]
hide
set [shown? v] to [0]
if <(shown?) = [1]> then
... :: grey
end
when I receive [is ... shown v]
if <(shown?) = [0]> then
... :: grey
end
- salvation_
-
100+ posts
If (sprite name) showing? block
Yes I want to use it in my game but it could also be useful for other people who are making similar projects. 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?
- salvation_
-
100+ posts
If (sprite name) showing? block
Yes but this would only work for the sprite who uses the shown variable not for the clones.Try to create a “sprite-only” variable and use broadcasts.YeaNo Support.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!show
set [shown? v] to [1]
hide
set [shown? v] to [0]
if <(shown?) = [1]> then
... :: grey
endwhen I receive [is ... shown v]
if <(shown?) = [0]> then
... :: grey
end
- Vercte
-
500+ posts
If (sprite name) showing? block
Actually, if you set it to sprite only, it DOES work for the clones. That's how you create a clone ID system.Yes but this would only work for the sprite who uses the shown variable not for the clones. ~snippity snip snip~
- salvation_
-
100+ posts
If (sprite name) showing? block
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!Actually, if you set it to sprite only, it DOES work for the clones. That's how you create a clone ID system.Yes but this would only work for the sprite who uses the shown variable not for the clones. ~snippity snip snip~
- Vercte
-
500+ posts
If (sprite name) showing? block
This is how: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!Actually, if you set it to sprite only, it DOES work for the clones. That's how you create a clone ID system.Yes but this would only work for the sprite who uses the shown variable not for the clones. ~snippity snip snip~
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_
-
100+ posts
If (sprite name) showing? block
But that hides the clones what if you want the clones shown?This is how: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!Actually, if you set it to sprite only, it DOES work for the clones. That's how you create a clone ID system.Yes but this would only work for the sprite who uses the shown variable not for the clones. ~snippity snip snip~
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
- Vercte
-
500+ posts
If (sprite name) showing? block
It works the other way, just set it to zero.
- Nambaseking01
-
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
But since this topic contains more discussion, I'll report the two topics to be merged

- coder2045
-
1000+ posts
If (sprite name) showing? block
define showDone.
show
set [shown? v] to [1]
define hide
hide
set [shown? v] to [0]
<(shown?) = [1]>
- salvation_
-
100+ posts
If (sprite name) showing? block
https://scratch-mit-edu.ezproxyberklee.flo.org/discuss/topic/69728/How do you report a topic to be a duplicate? There is an older duplicate for this topic:
But since this topic contains more discussion, I'll report the two topics to be merged
- salvation_
-
100+ posts
If (sprite name) showing? block
Yes but if you have two sprites or multiple clones that wouldn't work!define showDone.
show
set [shown? v] to [1]
define hide
hide
set [shown? v] to [0]
<(shown?) = [1]>