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

#1 2007-05-15 23:41:17

fandebiao
Scratcher
Registered: 2007-05-15
Posts: 25

How to display the value of a variable in a sprite

Hi.
I want to display the value of a variable in a sprite without using "say...", "think...", or "view on stage".  So for example, I have a sprite called Textbox, and a variable called Num.  How do I display Num in Textbox?
Thx in advance.

pw

Offline

 

#2 2007-05-16 00:29:22

Chupi
Scratcher
Registered: 2007-05-16
Posts: 4

Re: How to display the value of a variable in a sprite

How many different numbers must it be able to show?  If just a few, make a costume for each.  If more, make a few "digit" sprites and calculate the digits' values with / and mod.

Or, of course, just go to the variables page, check Num and drag the resulting box around where you want it.

Offline

 

#3 2007-05-19 01:46:54

kevin_karplus
Scratcher
Registered: 2007-04-27
Posts: 1000+

Re: How to display the value of a variable in a sprite

You can also look at my print_decimal program
http://scratch.mit.edu/projects/kevin_karplus/2951

Offline

 

Board footer