solarus-games / solarus

This repository was moved to GitLab: https://gitlab.com/solarus-games/solarus
http://www.solarus-games.org
Other
710 stars 134 forks source link

Allow scaling of drawable objects #998

Open ghost opened 7 years ago

ghost commented 7 years ago

We should allow sprites scaling. This is useful in a lot of situations. Roughly any situation in which you'd like to use a graphic in a different size than its source. Sometimes it is better to resize the actual source graphic, for instance if you want to have two sizes of a graphic, e.g. one for the world element, and one for the UI element. But in others, this is clearly not feasible -- e.g. if you want to have something expand from a very small size to a very big size in a smooth manner. Having, say, 300 source images that all need updating when you need to tweak the initial graphic, is just madness.

ghost commented 7 years ago

What's the best way to do this? Using glScale() (and whatever else for whatever else than OpenGL), or using SDL_gfx?

christopho commented 7 years ago

The solution would probably be to add an SDL_glx dependency, allow to scale and rotate surfaces, text surfaces and sprites from Lua scripts.

vlag commented 7 years ago

No need for SDL_glx for scaling sprites, SDL2 can already do that ( https://wiki.libsdl.org/SDL_RenderCopy?highlight=%28%5CbCategoryAPI%5Cb%29%7C%28SDLFunctionTemplate%29 )

christopho commented 7 years ago

No. It is for textures only.

ghost commented 7 years ago

1000 has the right of it -- this should be for all drawable objects, not just sprites.