Solarus Wiki

A wiki for the Solarus engine community

User Tools

Site Tools


upgrade_from_1.3_to_1.4

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
upgrade_from_1.3_to_1.4 [2015/05/02 15:14]
christopho [Upgrading Lua scripts]
upgrade_from_1.3_to_1.4 [2018/12/22 14:14] (current)
Line 31: Line 31:
 If you don't set the font, it will be by default the first one in alphabetical order. If you don't set the font size, the default value is 11. If you don't set the font, it will be by default the first one in alphabetical order. If you don't set the font size, the default value is 11.
  
-    * If your existing code calls {{http://​www.solarus-games.org/​doc/​1.4/​lua_api_text_surface.html#​lua_api_text_surface_create|sol.text_surface.create()}} or {{http://​www.solarus-games.org/​doc/​1.4/​lua_api_text_surface.html#​lua_api_text_surface_set_font|text_surface:​set_font()}} with a font id that does not corresponds ​to a font file without extension, then you need to fix this font id. For example, if you had like me a font called ''​fixed''​ referring to the font file ''​minecraftia.ttf'',​ the new font id to use is ''​minecraftia''​.+    * If your existing code calls {{http://​www.solarus-games.org/​doc/​1.4/​lua_api_text_surface.html#​lua_api_text_surface_create|sol.text_surface.create()}} or {{http://​www.solarus-games.org/​doc/​1.4/​lua_api_text_surface.html#​lua_api_text_surface_set_font|text_surface:​set_font()}} with a font id that does not correspond ​to a font file without extension, then you need to fix this font id. For example, if you had like me a font called ''​fixed''​ referring to the font file ''​minecraftia.ttf'',​ the new font id to use is ''​minecraftia''​.
     * If your existing code calls {{http://​www.solarus-games.org/​doc/​1.4/​lua_api_text_surface.html#​lua_api_text_surface_create|sol.text_surface.create()}} without setting an explicit font (therefore relying on the default font of ''​fonts.dat''​),​ then you should set the font to use, because otherwise the default font would now be the first one in alphabetical order. You can do this in the table parameter of {{http://​www.solarus-games.org/​doc/​1.4/​lua_api_text_surface.html#​lua_api_text_surface_create|sol.text_surface.create()}} (the ''​font''​ field) or with {{http://​www.solarus-games.org/​doc/​1.4/​lua_api_text_surface.html#​lua_api_text_surface_set_font|text_surface:​set_font()}}.     * If your existing code calls {{http://​www.solarus-games.org/​doc/​1.4/​lua_api_text_surface.html#​lua_api_text_surface_create|sol.text_surface.create()}} without setting an explicit font (therefore relying on the default font of ''​fonts.dat''​),​ then you should set the font to use, because otherwise the default font would now be the first one in alphabetical order. You can do this in the table parameter of {{http://​www.solarus-games.org/​doc/​1.4/​lua_api_text_surface.html#​lua_api_text_surface_create|sol.text_surface.create()}} (the ''​font''​ field) or with {{http://​www.solarus-games.org/​doc/​1.4/​lua_api_text_surface.html#​lua_api_text_surface_set_font|text_surface:​set_font()}}.
     * If your existing code used any font with a size different from 11, you have to set that size whenever you use this font. You can do this in the table parameter of {{http://​www.solarus-games.org/​doc/​1.4/​lua_api_text_surface.html#​lua_api_text_surface_create|sol.text_surface.create()}} (the ''​size''​ field) or with {{http://​www.solarus-games.org/​doc/​1.4/​lua_api_text_surface.html#​lua_api_text_surface_set_font_size|text_surface:​set_font_size()}}.     * If your existing code used any font with a size different from 11, you have to set that size whenever you use this font. You can do this in the table parameter of {{http://​www.solarus-games.org/​doc/​1.4/​lua_api_text_surface.html#​lua_api_text_surface_create|sol.text_surface.create()}} (the ''​size''​ field) or with {{http://​www.solarus-games.org/​doc/​1.4/​lua_api_text_surface.html#​lua_api_text_surface_set_font_size|text_surface:​set_font_size()}}.
upgrade_from_1.3_to_1.4.txt ยท Last modified: 2018/12/22 14:14 (external edit)