Discuss Scratch

TobiNSpiller
Scratcher
40 posts

Changing size after character lenght?

How do you make sprites smaller for the longer amount of characters there is in a variable?

Last edited by TobiNSpiller (June 15, 2018 21:26:42)

best-games-ever
Scratcher
500+ posts

Changing size after character lenght?

I think that can't happen with variables, you probably have to use lists.
crisostimo
Scratcher
500+ posts

Changing size after character lenght?

Depends on what you are looking for, but something along the lines of:

set size to ((100) / (length of (My Variable))) %
TobiNSpiller
Scratcher
40 posts

Changing size after character lenght?

crisostimo wrote:

Depends on what you are looking for, but something along the lines of:

set size to ((100) / (length of (My Variable))) %
Yeah, it looks right besides it doesn't scale it exactly how I want it. It get's too small when the amount of characters gets longer.
deck26
Scratcher
1000+ posts

Changing size after character lenght?

TobiNSpiller wrote:

crisostimo wrote:

Depends on what you are looking for, but something along the lines of:

set size to ((100) / (length of (My Variable))) %
Yeah, it looks right besides it doesn't scale it exactly how I want it. It get's too small when the amount of characters gets longer.
So work out approximate sizes for different lengths and see if you can establish a relationship. Or use the equation above but add a constant so you have a mimum size.

For example.
set size to ([20] + ((80) / (length of (My Variable))) %
cc_scratch_cc
Teacher
24 posts

Changing size after character lenght?

may you need

set size = 100% / sqrt(objAmount)

set size to ((100) / ([sqrt] of (amount))) %

Powered by DjangoBB