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

#1 2011-07-06 23:43:32

Thescratch3
Scratcher
Registered: 2011-06-14
Posts: 1000+

Hiding the ScrollX

I need some help with another project. Okay I am making a simple project using scrollX. But I don't know how to hide the objects in the first place. The player can easily see the objects upcoming before it even appears to them! How can I hide the objects until the player reaches that point and then those objects will show?


View my projects. Or face The scratch curse! (Get it?)
http://i56.tinypic.com/2cdk8hy.png

Offline

 

#2 2011-07-07 03:29:56

jalkan
Scratcher
Registered: 2009-05-14
Posts: 25

Re: Hiding the ScrollX

use a black border on the sides

Offline

 

#3 2011-07-07 05:48:22

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: Hiding the ScrollX

A black border is one way, yes. Another way is to figure out the range of scrollx values for which each sprite should be visible, and then make a script for each that hides it when scrollx is not within that range.


http://www.blocks.scratchr.org/API.php?action=random&return=image&link1=http://i.imgur.com/OZn2RD3.png&link2=http://i.imgur.com/duzaGTB.png&link3=http://i.imgur.com/CrDGvvZ.png&link4=http://i.imgur.com/POEpQyZ.png&link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

#4 2011-07-07 06:58:27

EdnaC
Scratcher
Registered: 2007-08-28
Posts: 100+

Re: Hiding the ScrollX

I'm not sure what "scrollX" is, but you can control the visibility of sprites by just hiding them:

If <[abs (xposition)]>235
   Hide
Else
   Show

You may have to experiment with the value for how far your sprite can go efore you want it to disappear.  Put the code in a forever loop - a short "wait" statement is OK in that loop too.

Offline

 

#5 2011-07-07 14:27:26

Thescratch3
Scratcher
Registered: 2011-06-14
Posts: 1000+

Re: Hiding the ScrollX

Harakou wrote:

A black border is one way, yes. Another way is to figure out the range of scrollx values for which each sprite should be visible, and then make a script for each that hides it when scrollx is not within that range.

I think I could show the scrollX and then set a position of Scrollx to make the sprites that are involuntarily showing. Like showing scrollX, I could play it and see it, but I already posted it and am too lazy to fix it  tongue .


View my projects. Or face The scratch curse! (Get it?)
http://i56.tinypic.com/2cdk8hy.png

Offline

 

#6 2011-08-30 05:40:10

KobyStudios
Scratcher
Registered: 2011-06-30
Posts: 6

Re: Hiding the ScrollX

you can see how to do it in my project.
http://scratch.mit.edu/projects/KobyStudios/2003639

Offline

 

#7 2011-08-30 08:27:00

ImagineIt
Scratcher
Registered: 2011-02-28
Posts: 1000+

Re: Hiding the ScrollX

EdnaC wrote:

I'm not sure what "scrollX" is, but you can control the visibility of sprites by just hiding them:

If <[abs (xposition)]>235
   Hide
Else
   Show

You may have to experiment with the value for how far your sprite can go efore you want it to disappear.  Put the code in a forever loop - a short "wait" statement is OK in that loop too.

I use 460

Offline

 

Board footer