Hi,
I was wondering if there is a way to scale a sprite, but instead of it stretching and loosing it's shape, it repeats. It would be handy for a ladder sprite for example.
Thanks.
Hi,
I was wondering if there is a way to scale a sprite, but instead of it stretching and loosing it's shape, it repeats. It would be handy for a ladder sprite for example.
Thanks.
A custom shader could definitely achieve this.
If you use a Tilemap, then you can do stuff like this, I think that was the design for classic 2D games. However, it would be handy to repeat a texture, I didn't see any easy way to do this, but maybe I missed something.
basically repeating texture + UV scaling should do it. It should be a good practice project to learn a bit about shaders, so I'm inclined to just leave it as a homework assignment, so to speak.
some people don't have the time to learn how to write shaders for a simple issue like this.
I find your answer as unnerving as a "nvm, found the issue" reply ^^
tuxlu Perhaps, but 1. I'm not stopping anyone else from giving the answer(in fact I'm hoping more users will be motivated to engage with low hanging fruit like this available for the taking). 2. godots shader language isn't all that different from glsl, you can probably find examples of this in glsl you can easily port over without a deep understanding of shaders/glsl. 3. I have in the past shared shadergraphs for this very thing.
Basic idea is to take the time builtin variable and add or subtract from x or y component of UV coordinates. That's if you want to animate UV scrolling. Other wise just add whatever value you need to a UV component(x or y). It's very much a 101 basics of this.
+ or - to/from UV component = translation
* or / from UV component = scaling/sizing
It's a simple issue, yes, but I don't believe Godot supports this by default. Meaning your only option is a custom solution, which shaders are the most obvious.