Discuss Scratch
- Discussion Forums
- » Suggestions
- » Changing Width and Height Separately
- 56-s
-
Scratcher
500+ posts
Changing Width and Height Separately
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)
- 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
BRO * is this. i cant understand HOW THE HECK DO I ONLY CHANGE THE WIDHT OR HEIGHT???? SOMEONE TELL MEEEEEEThis 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
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
It would be super useful for animation
- MagentaDude1359
-
Scratcher
100+ posts
Changing Width and Height Separately
BRO * is this. i cant understand HOW THE HECK DO I ONLY CHANGE THE WIDHT OR HEIGHT???? SOMEONE TELL MEEEEEEuse 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
(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?
- 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
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
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
you can just use fisheye stretchWhich 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
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 detectionThat'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
Yeah but to stretch you must know the width of the costume so you can scale the x coordinate by goal width / width.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 detectionThat'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.
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)
- Discussion Forums
- » Suggestions
-
» Changing Width and Height Separately
















