I have a pretty big “background” think like 500.000 x 500.000 px. I have placed a camera to be able to zoom & pan within that background. On top of it, there are a sparse amount of small sprites. Think of planets in a star or similar.
Of course, when i zoom out, the sprites become so small to be invisible. This is expected, but not desired. What i would like is to have some kind of correlation between sprite zoom & camera zoom, so that all the sprites get magnified when i zoom too much out.
I also draw some lines, and i managed to obtain this effect by setting line size to -1.0, so that all lines are always visible. What could i do for the sprites?
You do that by attaching a script to the sprites, I guess. Drop you request into any of the free AIs available online, and it will literally generate the script for you.
In your zoom code, I recommend sending out a signal of the zoom level. Then in your planets, listen for that signal and handle their own zooming in their code. You may want to use an Autoload for passing the signal.
I do not recommend trying to get AI to help you with this. LLMs are not good tools for learning. They will make things up and confidently telling that their lies are true.
I am having serious issues in replying via mobile, this forum UI somehow doesn’t play nice.
Anyway, I will definitely ignore the AI route comment as that is opposite to what of a forum is supposed to be, thank you. Will dig into the signal stuff.
Signals are not really needed for basic functionality here. You can simply scale all the sprites from the script that does zooming. To keep the size, set scale to 1 / zoom scale. To converge slower than zoom, multiply that with some factor.
Not with simple scripts like the one needed here. I find the AI to be a great help for questions that were asked a thousand times. Hardly worse than a forum thread with no answers.
So you start relying on copypasting generated code for easy problems, not putting effort to gradually develop your knowledge, understanding and problem solving abilities. Then you get to a harder problem. Then what?
Who tells you to copypaste? Not me. Get it to generate the script and explain what different parts do, learn from that. In seconds. Come to a forum when basic tools fail. On the other hand, why waste hours on learning about something this trivial?
That’s why you need to cultivate problem solving abilities so you can solve problems yourself instead of relying on instant “answers”. Tutorial hell is bad but LLM hell is worse. It causes even greater mental inertia.
Nah, thanks! Not interested in discussing this any more. LLMs are fine for quick retrieval of some common boilerplate. If you rely on them for more than that, your coding efforts likely won’t end up in a good place.