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

#1 2011-01-15 16:56:58

ZaRiTo
Scratcher
Registered: 2009-04-24
Posts: 100+

On-Screen Variable Troubles?

I have a problem:
On this project, I added an on-screen variable. However, I had a title screen, and used the "show variable" block.
However, while I wanted my variable to appear on the bottom right of the screen, it appeared on the top left. Yes, I tried dragging it.

So my question is this: How do I make non-on-screen variables?
(I have my number sprites, but I need to know how to script them to synchronize with the variable. Can anyone help me with this?)


Short Stories: Writing and Criticism
A Gallery for writers, readers, and everyone else.

Offline

 

#2 2011-01-17 07:48:52

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

Re: On-Screen Variable Troubles?

What do you mean? Are you trying to move the variable window?


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

 

#3 2011-01-17 09:04:19

Lar-Rew
Scratcher
Registered: 2010-02-19
Posts: 100+

Re: On-Screen Variable Troubles?

If you mean that variables always appear in the top left, if you save the project while the variable is visible, it will auto-reappear in the spot it was when you saved the project when you use the "show variable" block.  So you really don't need to create your own variable at all, if that is all you're worried about.

If you want to create your own variables which can move, don't require an orange border, etc., you can code your variables a variety of ways.  In your case, the simplest way would be to make a sprite with the costumes starting at 0 and going up to 30, or whatever the largest number you'll ever need to display is.  Then make a script like this:

http://lasergnlsdjkfila.weebly.com/uploads/4/6/4/3/4643709/8347947.gif

There are more complicated ways that use multiple sprites or stamping, but this script should work.

Last edited by Lar-Rew (2011-01-17 09:15:53)

Offline

 

#4 2011-01-27 19:57:15

ZaRiTo
Scratcher
Registered: 2009-04-24
Posts: 100+

Re: On-Screen Variable Troubles?

OK. Sorry, haven't checked this post for a while, thanks. You were a great help!!!
I'm currently updating my project. That's exactly what I needed.  big_smile


Short Stories: Writing and Criticism
A Gallery for writers, readers, and everyone else.

Offline

 

Board footer