Discuss Scratch

Purpleleaf09
Scratcher
19 posts

Invisible Sprites

How can I have an object be invisible but still have the properties of being shown? For example, if you click on a certain place on a blank screen, something will happen. Thanks in advance.
21lyoja
Scratcher
100+ posts

Invisible Sprites

setghosteffectto100
This basically makes the sprite fully transparent.
Spontaneous08
Scratcher
100+ posts

Invisible Sprites

whenclickedshowforevershowiftouching mouse?andmousedown?thendowhatyouwantittodowhenclickedhide

Try that.
Purpleleaf09
Scratcher
19 posts

Invisible Sprites

Thanks!
21lyoja
Scratcher
100+ posts

Invisible Sprites

Spontaneous08 wrote:

whenclickedshowforevershowiftouching mouse?andmousedown?thendowhatyouwantittodowhenclickedhide

Try that.
That'd work, but the problem is that it'd flash on and off of the screen, visually.
asivi
Scratcher
1000+ posts

Invisible Sprites

whenclickedsetghosteffectto100showforeverwaituntiltouching mouse?andmousedown?setghosteffectto0dowhatyouwantittodowhenclickedsetghosteffectto100

.

Last edited by asivi (July 16, 2016 01:39:08)

21lyoja
Scratcher
100+ posts

Invisible Sprites

Actually, I tried my script and it didn't work. But if you set it to 99 instead of 100, it does. Still very invisible, and actually works.
asivi
Scratcher
1000+ posts

Invisible Sprites

21lyoja wrote:

Actually, I tried my script and it didn't work. But if you set it to 99 instead of 100, it does. Still very invisible, and actually works.
The ghost effect works fine for me.
21lyoja
Scratcher
100+ posts

Invisible Sprites

asivi wrote:

21lyoja wrote:

Actually, I tried my script and it didn't work. But if you set it to 99 instead of 100, it does. Still very invisible, and actually works.
The ghost effect works fine for me.
What I meant is that the ghost still works as it's supposed to, but when your ghost value is at 100 the sprite cannot be clicked.
asivi
Scratcher
1000+ posts

Invisible Sprites

21lyoja wrote:

asivi wrote:

21lyoja wrote:

Actually, I tried my script and it didn't work. But if you set it to 99 instead of 100, it does. Still very invisible, and actually works.
The ghost effect works fine for me.
What I meant is that the ghost still works as it's supposed to, but when your ghost value is at 100 the sprite cannot be clicked.
The same thing that i've said before,. that's not happening to me.
My browser / operating system: Windows 7, Firefox 47.0, Flash 22.0 (release 0)

Last edited by asivi (July 17, 2016 19:36:37)

21lyoja
Scratcher
100+ posts

Invisible Sprites

asivi wrote:

21lyoja wrote:

asivi wrote:

21lyoja wrote:

Actually, I tried my script and it didn't work. But if you set it to 99 instead of 100, it does. Still very invisible, and actually works.
The ghost effect works fine for me.
What I meant is that the ghost still works as it's supposed to, but when your ghost value is at 100 the sprite cannot be clicked.
The same thing that i've said before,. that's not happening to me.
My browser / operating system: Windows 7, Firefox 47.0, Flash 22.0 (release 0)
Huh. What I did is I created a project where the normal scratch cat's ghost value is set to 100, and if it is clicked, it changes a variable by 1. It wasn't changing the variable. I then changed the ghost value to 99, and it worked fine.
asivi
Scratcher
1000+ posts

Invisible Sprites

21lyoja
Scratcher
100+ posts

Invisible Sprites

Here's what I had:
whenclickedsetclicked?to0setghosteffectto100

whenthisspriteclickedchangeclicked?by1

And it didn't work. I understand how yours worked and mine didn't, though, with the mouse down and touching mouse sensory blocks.
asivi
Scratcher
1000+ posts

Invisible Sprites

I've tested yours and the event block is unable to detect the sprite as you said.
Spontaneous08
Scratcher
100+ posts

Invisible Sprites

https://scratch.mit.edu/projects/116489211/

And you said my idea wouldn't work
asivi
Scratcher
1000+ posts

Invisible Sprites

Spontaneous08 wrote:

https://scratch.mit.edu/projects/116489211/

And you said my idea wouldn't work
Yours works but adding lag because the hide an show are in a forever loop.
Spontaneous08
Scratcher
100+ posts

Invisible Sprites

Yes, but a forever loop does not add much lag, if any at all, unless you have a crappy computer.
asivi
Scratcher
1000+ posts

Invisible Sprites

Spontaneous08 wrote:

Yes, but a forever loop does not add much lag, if any at all, unless you have a crappy computer.
That isn't a valid reason to make an script inefficient.
Spontaneous08
Scratcher
100+ posts

Invisible Sprites

If you feel like ‘forever’ is ‘innificient’ then why don't you replace it with a
repeatuntil

And before you say ‘Yeah, but that causes lag too’, guess what the most viewed project on scratch is? Paper Minecraft. Take a quick look at the scripts and you will see that that ‘repeat’ block is used very often.

Also, I don't think he will make a very complex project where lag will be very much of a problem.
asivi
Scratcher
1000+ posts

Invisible Sprites

The whole script is inefficient not only a block, The blocks causing more lag are problaby the related with graphics, all belonging to looks (Show and Hide included) set of blocks, and those intended to detect a color when touching.

Powered by DjangoBB