Discuss Scratch

fluffy0006
Scratcher
25 posts

How do you create custom variables?

I've been getting annoyed with the ugly looking normal variables, can you reply to this with the ways you create your own variables that look good.
when green flag clicked
forever
annoyed with variables
end

Last edited by fluffy0006 (June 25, 2020 15:49:25)

fluffy0006
Scratcher
25 posts

How do you create custom variables?

AAAAAARRRRRGGGGHHHH!!!! Custom variables are so annoying to make!!!
when green flag clicked
forever
Annoyed
end
fluffy0006
Scratcher
25 posts

How do you create custom variables?

when I receive [start of life v]
forever
annoyed with variables arggghh
end
Fluffyman006
Scratcher
4 posts

How do you create custom variables?

when I receive [start of eternity v]
forever
bacon
end
Fluffyman006
Scratcher
4 posts

How do you create custom variables?

qucchia
Scratcher
100+ posts

How do you create custom variables?

What do you mean by “custom variables”? Do you mean to change how they are displayed on the screen? If so, what variable are you trying to customise?
fluffy0006
Scratcher
25 posts

How do you create custom variables?

qucchia wrote:

What do you mean by “custom variables”? Do you mean to change how they are displayed on the screen? If so, what variable are you trying to customise?
Yes, I mean changing the way the are displayed.
qucchia
Scratcher
100+ posts

How do you create custom variables?

Is the variable displaying a number or some text?
fluffy0006
Scratcher
25 posts

How do you create custom variables?

qucchia wrote:

Is the variable displaying a number or some text?
Text
qucchia
Scratcher
100+ posts

How do you create custom variables?

You can use a pen text engine to draw the text. You can choose font, colour, size, and more. Here's an example of a pen text engine
fluffy0006
Scratcher
25 posts

How do you create custom variables?

qucchia wrote:

You can use a pen text engine to draw the text. You can choose font, colour, size, and more. Here's an example of a pen text engine
Oh, sorry I meant numbers, I'm tired.
Wyan100
Scratcher
1000+ posts

How do you create custom variables?

Okay so here we have to options:

1. You can right-click the variable on screen and select a different display

2. You can make a text engine

If you want to make a text engine then take a sprite with a costume for each letter of the alphabet (make sure all the costumes are named there respective letter), then use a code something like this:

define write (Text) at (Ypos.) 
broadcast [Clean up v] // Whether this has screen refresh or not will effect whether the text appears immediately or is slowly spelled out on screen
set [Counter v] to [1]
go to x: (-150) y: (Ypos.)
repeat (length of (Text))
if <(letter (Counter) of (Text)) = [ ]> then // This empty square represents a space
change x by (20)
else
switch costume to (letter (Counter) of (Text))
create clone of [myself v]
change x by (10)
end
change [Counter v] by (1)
end

when I receive [Clean up v]
delete this clone

when I start as a clone
show
play sound [Tap v] until done // Remove this if you want the typing to be silent

Of course the coding is slightly different in every project, but this is the basic idea.

Edit: My First Ninja'd

Last edited by Wyan100 (June 25, 2020 16:24:53)

fluffy0006
Scratcher
25 posts

How do you create custom variables?

Wyan100 wrote:

Okay so here we have to options:

1. You can right-click the variable on screen and select a different display

2. You can make a text engine

If you want to make a text engine then take a sprite with a costume for each letter of the alphabet (make sure all the costumes are named there respective letter), then use a code something like this:

define write (Text) at (Ypos.) 
broadcast [Clean up v] // Whether this has screen refresh or not will effect whether the text appears immediately or is slowly spelled out on screen
set [Counter v] to [1]
go to x: (-150) y: (Ypos.)
repeat (length of (Text))
if <(letter (Counter) of (Text)) = [ ]> then // This empty square represents a space
change x by (20)
else
switch costume to (letter (Counter) of (Text))
create clone of [myself v]
change x by (10)
end
change [Counter v] by (1)
end

when I receive [Clean up v]
delete this clone

when I start as a clone
show
play sound [Tap v] until done // Remove this if you want the typing to be silent

Of course the coding is slightly different in every project, but this is the basic idea.

Edit: My First Ninja'd
Thnx
boocrew13
Scratcher
49 posts

How do you create custom variables?

hello im from 2021
Jbear_
Scratcher
1000+ posts

How do you create custom variables?

boocrew13 wrote:

hello im from 2021


Please don’t necro post. This post was a few months ago and you posting on a old, irrelevant topic is not necessary
scripty1101
Scratcher
1 post

How do you create custom variables?

hi im from 2023 lol

Powered by DjangoBB