Discuss Scratch

-vvr1-
Scratcher
8 posts

On screen keyboard, using one sprite and clones. can someone help me?

I am trying to make an on-screen keyboard, using 1 sprite but with clones, but with only numbers and operators. I also need it to store its text in a variable, and be able to be called upon and animated. Can someone help me?
1nteger_
Scratcher
42 posts

On screen keyboard, using one sprite and clones. can someone help me?

I'de recommend something like this:

define clicked (key)
do something

when green flag clicked
switch costume to [q v]
create clone of [myself v]
switch costume to [w v]
create clone of [myself v]
switch costume to [e v]
create clone of [myself v]
switch costume to [r v]
create clone of [myself v]
switch costume to [t v]
create clone of [myself v]
switch costume to [y v]
create clone of [myself v]
and so on

when I start as a clone
go to x: (item (item # of (costume [name v]) in [key names v]) of [key x v] :: list) y: (item (item # of (costume [name v]) in [key names v]) of [key y v] :: list)
forever
if <<mouse down?> and <touching [mouse-pointer v] ?>> then
set [brightness v] effect to (-10)
clicked (costume [name v])
set [brightness v] effect to (0)
wait until <not <<mouse down?> and <touching [mouse-pointer v] ?>>>
end
end

Key names list is all the costume names in order, Key X and Y are each keys positions.
-vvr1-
Scratcher
8 posts

On screen keyboard, using one sprite and clones. can someone help me?

uh can you help me with the lists?

Last edited by -vvr1- (May 26, 2025 09:38:31)

Scyth3d
Scratcher
500+ posts

On screen keyboard, using one sprite and clones. can someone help me?

-vvr1- wrote:

uh can you help me with the lists?
What do u need help with?

Basically you add qwedrtyuiopasdfghjklzxcvbnm and special chars if you want to “key names” you add the x position of where you want a key to go in “key x” and you add the y pos to key 1

Eg

Item 1 key names:
1. Q
2. W
key x
1. 23
2. 88
Key y
1. 25
2. 55

Q would go to x:23 y:25 and w would go to x:88 y:55

Also ensure your costume names are simply “q” “w” etc with nothing else

Last edited by Scyth3d (May 26, 2025 09:50:27)

-vvr1-
Scratcher
8 posts

On screen keyboard, using one sprite and clones. can someone help me?

Scyth3d wrote:

-vvr1- wrote:

uh can you help me with the lists?
What do u need help with?

Basically you add qwedrtyuiopasdfghjklzxcvbnm and special chars if you want to “key names” you add the x position of where you want a key to go in “key x” and you add the y pos to key 1

Eg

Item 1 key names:
1. Q
2. W
key x
1. 23
2. 88
Key y
1. 25
2. 55

Q would go to x:23 y:25 and w would go to x:88 y:55

Also ensure your costume names are simply “q” “w” etc with nothing else
can you dumb down that message for me, I don't understand that. I'm not that good at scratch.

Last edited by -vvr1- (May 27, 2025 02:43:46)

Powered by DjangoBB