Widget Candy. .LoadTheme()

Widget Candy
Send Snippet To: Save this snippet to Code Collector Pro -- view all roger's snippets
language: Other
license: Other

Code for Snippet:

                
Loads a new widget theme ("skin" or style) into memory. Once a theme is loaded, it can be applied to any widget to determine its look, colors etc. Each theme consists of a .lua file that is placed in your project's root and a folder (also to be placed in your project's root file). Within this folder, you can collect all graphics and sounds used for this theme.
 
NOTE: When using custom vector fonts in your app, please make sure that you
 
• Specify the correct font name in your theme's settings .lua file.
• With Corona SDK, specify the correct font name in your build.settings file.
• The font must be properly installed on your machine.
• The font should be placed within your project's root folder.
Follow these links to learn how to embed your own vector fonts using the Corona SDK:
• Using a custom font
• Embedding a custom font (forum topic)
 
-- REQUIRE THE LIBRARY
_G.GUI = require("widget_candy")
 
-- LOAD A THEME
_G.GUI.LoadTheme("theme_1", "themes/theme_1/")
 
 
 
LoadTheme (themeFile, folderPath)
 
themeFile	(String) The name of the theme's .lua settings file (just the file name, without the .lua extension). To apply this theme to any widget once it has been loaded, use this name for a widget's ".theme" property.
 
 
folderPath	(String) The path to the theme's folder (where all graphics and sounds used for this theme are stored). Do not forget the trailing slash at the end of the path string.
 
 
 
 
 
 
 
 
comments powered by Disqus

Info

Link to this snippet:


Download to Code Collector

To use the direct link to your snippet on CodeCollector.net either copy the html from the above section or drag the Download to Code Collector to where you would like to use it.

More Info:

Times Viewed: 5
Date Added: 2018-01-10 14:24:18
Last Modified: 2018-01-10 09:54:13

Web Analytics