Is Surface bellow layers possible ?

Started by MetalZelda, November 09, 2015, 04:52:18 PM

Previous topic - Next topic
November 09, 2015, 04:52:18 PM Last Edit: November 09, 2015, 04:56:45 PM by Username
Hi.

Does Solarus accept drawable objects (surface) to be bellow all layers ? I do have checked the API http://www.solarus-games.org/doc/latest/lua_api_surface.html and it doesn't seems to have some parameters like putting it on a certain layer or bellow
http://www.solarus-games.org/doc/latest/lua_api_drawable.html#lua_api_drawable_draw_region
This would be cool if there were a parameter "height" in drawable:draw (desired layer or top or bellow all)

Example of use :
This could be useful for auto-scrolling backgrounds

Not really. You have to use an additional layer for the background. Solarus 1.5 will allow unlimited layers.


To allow custom background, there should be new events map:on_pre_draw() and map:on_post_draw(). For now there is only map:on_draw(), which occurs after the map is drawn and before its menus are drawn.
A problem is that the background color of the tileset should not overwrite what is done in map:on_pre_draw(). Maybe the background color of the tileset should be optional, or maybe defining it should become a default background in case map:on_pre_draw() is not defined?

Quote from: Christopho on November 09, 2015, 05:25:17 PM
To allow custom background, there should be new events map:on_pre_draw() and map:on_post_draw(). For now there is only map:on_draw(), which occurs after the map is drawn and before its menus are drawn.
A problem is that the background color of the tileset should not overwrite what is done in map:on_pre_draw(). Maybe the background color of the tileset should be optional, or maybe defining it should become a default background in case map:on_pre_draw() is not defined?

Hmmm, I was talking about image-based background, for the color that might be the same thing