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

Request: functions sprite:flip() #720

Open Diarandor opened 9 years ago

Diarandor commented 9 years ago

It could be useful to have a function to flip a sprite, horizontally or vertically, which would affect all its animations. This could help to reduce the size of files for some sprite sets. The syntax could be sprite:flip(string), where string admits values "horizontal", "vertical" or "both". It could be defined more in general for drawable entities.

Anyway, these functions could be scripted in Lua if there were functions to get/set the sprites of drawable entities, which would be very useful (one could even script rotations, color changes, and other transformations of sprites using some algorithm). I think that there is already an issue asking for this (or something similar): https://github.com/christopho/solarus/issues/452

llamaizing commented 7 years ago

For the purposes of reducing the file size of sprite sets, wouldn't it be better to add a flip property to the .dat file for sprites/tilesets? Then you could just set the value from a drop-down menu in the quest editor and not have to mess around with lua functions.

For the purposes of modifying things dynamically at run-time, #452 is probably the better way to go.