Discuss Scratch

medians
Scratcher
1000+ posts

Changing Width and Height Separately

Bringing this topic up.
56-s
Scratcher
500+ posts

Changing Width and Height Separately

medians wrote:

Bringing this topic up.
“Bring up my post” (Bump)

EDIT: anyway let's get on topic

Last edited by 56-s (Sept. 24, 2023 17:49:23)

HenWiii
Scratcher
13 posts

Changing Width and Height Separately

support [TREE(3)]
Mysterios_Develepor
Scratcher
1 post

Changing Width and Height Separately

BRO * is this. i cant understand HOW THE HECK DO I ONLY CHANGE THE WIDHT OR HEIGHT???? SOMEONE TELL MEEEEEE
54387a
Scratcher
1000+ posts

Changing Width and Height Separately

Mysterios_Develepor wrote:

BRO * is this. i cant understand HOW THE HECK DO I ONLY CHANGE THE WIDHT OR HEIGHT???? SOMEONE TELL MEEEEEE
This suggestion is about suggesting the abillity to stretch sprites. Currently, you can't stretch sprites.
thedogcoder440
Scratcher
100+ posts

Changing Width and Height Separately

bump

Last edited by thedogcoder440 (Oct. 19, 2023 07:22:08)

ajskateboarder
Scratcher
1000+ posts

Changing Width and Height Separately

Bump

Support because I know there are a lot of good use cases for this
MagentaDude1359
Scratcher
100+ posts

Changing Width and Height Separately

you can just use fisheye stretch
P-P-C
Scratcher
34 posts

Changing Width and Height Separately

100 % support
It would be super useful for animation
MagentaDude1359
Scratcher
100+ posts

Changing Width and Height Separately

Mysterios_Develepor wrote:

BRO * is this. i cant understand HOW THE HECK DO I ONLY CHANGE THE WIDHT OR HEIGHT???? SOMEONE TELL MEEEEEE
use this
Ultracoder1010
Scratcher
100+ posts

Changing Width and Height Separately

Support it has a lot of uses such as health bars, animations, projects that use rotation, already been implemented with scratch alternatives and wouldn’t make scratch worse also the width and height parameters would be useful for tile based projects, text engines and number counters
TheCreatorOfUnTV
Scratcher
1000+ posts

Changing Width and Height Separately

You can split the sprite into 8x8 pixels and move those pixels around as well as a Super-Mario-Kart-like different-sprites-for-different-widths for bitmap sprites, or add dots to the edges of vector sprites, but both of those are difficult to do correctly (and in the case of the latter inaccurate), so this is a great suggestion.

Last edited by TheCreatorOfUnTV (July 17, 2024 19:48:50)

ruvel_ztu
Scratcher
14 posts

Changing Width and Height Separately

epicanna27 wrote:

(size)
(width :: looks)
(height :: looks)

I support this idea, but if the width and the height are not equal, what would be the size then?
CodeKing_11
Scratcher
100+ posts

Changing Width and Height Separately

Support. ST, where are you?
Wubba4900
Scratcher
2 posts

Changing Width and Height Separately

How do you go past 600 pixels in height

https://scratch.mit.edu/projects/1149612585 Seven-Sez-Two is too tall, is there things to help me

Last edited by Wubba4900 (May 4, 2025 11:00:45)

Scyth3d
Scratcher
500+ posts

Changing Width and Height Separately

9

HenWiii wrote:

support [TREE(3)]
support TREE(tree(tree(tree(tree(tree(372368463487236423874632874326487327462847236)))))::operator)
Also paddle literally said this is a good idea how is this not added

Last edited by Scyth3d (May 3, 2025 16:24:07)

BigNate469
Scratcher
1000+ posts

Changing Width and Height Separately

MagentaDude1359 wrote:

you can just use fisheye stretch
Which isn't perfect and is fairly complicated.
undeterministic3
Scratcher
12 posts

Changing Width and Height Separately

Ok but then the shader would be kinda complicated as first you would have to scale horizontally to one which means knowing the width. But I don't know if GLSL has AABB detection
BigNate469
Scratcher
1000+ posts

Changing Width and Height Separately

undeterministic3 wrote:

Ok but then the shader would be kinda complicated as first you would have to scale horizontally to one which means knowing the width. But I don't know if GLSL has AABB detection
That's what vertex shaders are for.

Yes, doing this with a fragment shader would be next to impossible unless you already knew the width and height of the sprite, and there was only one sprite on the stage. Vertex shaders exist solely to move vertices (in this case, the mathematical points describing the triangles that that make up a sprite) so stretching isn't hard for them.

Last edited by BigNate469 (May 3, 2025 19:53:12)

undeterministic3
Scratcher
12 posts

Changing Width and Height Separately

BigNate469 wrote:

undeterministic3 wrote:

Ok but then the shader would be kinda complicated as first you would have to scale horizontally to one which means knowing the width. But I don't know if GLSL has AABB detection
That's what vertex shaders are for.

Yes, doing this with a fragment shader would be next to impossible unless you already knew the width and height of the sprite, and there was only one sprite on the stage. Vertex shaders exist solely to move vertices (in this case, the mathematical points describing the triangles that that make up a sprite) so stretching isn't hard for them.
Yeah but to stretch you must know the width of the costume so you can scale the x coordinate by goal width / width.
Also I think this is how stretching would work
#ifdef ENABLE_stretch
{
vec2 stretchFactor = vec2(u_stretch, 1.0); // Example: stretch 2x in X, no change in Y

vec2 vec = (texcoord0 - kCenter) / kCenter; // Normalize texture coordinates around center
vec2 stretchedVec = vec * stretchFactor; // Apply the stretch factor

texcoord0 = kCenter + stretchedVec * kCenter;
}
#endif

Last edited by undeterministic3 (May 3, 2025 19:55:40)

Powered by DjangoBB