Widget Candy GENERAL WIDGET PROPERTIES

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

Code for Snippet:

                
x = (String or Number) Specifies the horizontal position of the widget. Possible values are:
"left"
"right"
"center"
"0%" to "100%" (using quotes)
Any integer number
Use "left", "right" and "center" to align the widget either to the left, right or middle of the widget's parent (or the screen, if the widget is not placed inside a display group or a window widget).
Use a percentage value in quotes from "0%" to "100%" to place the widget relative to its parent's width (the widget's top left corner is used to determine the position).
Use any number (without quotes) to place the widget on an absolute position.
——————————————————————————
y =(String or Number) Specifies the vertical position of the widget. Possible values are:
"top"
"bottom"
"center"
"0%" to "100%" (using quotes)
Any integer number
Use "top", "bottom" and "center" to align the widget either to the top, bottom or middle of the widget's parent (or the screen, if the widget is not placed inside a display group or a window widget).
Use a percentage value in quotes from "0%" to "100%" to place the widget relative to its parent's height (the widget's top left corner is used to determine the position).
Use any number (without quotes) to place the widget on an absolute position.
——————————————
width =(String or Number) Specifies the width of the widget. Possible values are:
"0%" to "100%" (using quotes)
Any integer number
Use a percentage value in quotes from "0%" to "100%" to specify the widget's width relative to its parent's width (which can be a display group, a window widget or the screen itself, if the widget is not placed inside a parent).
Use any number (without quotes) to specify an exact, absolute width.
————————————
height =(String or Number) Specifies the height of the widget. Possible values are:
"0%" to "100%" (using quotes)
Any integer number
Use a percentage value in quotes from "0%" to "100%" to specify the widget's height relative to its parent's height (which can be a display group, a window widget or the screen itself, if the widget is not placed inside a parent).
Use any number (without quotes) to specify an exact, absolute height.
—————————————————————————
 
name = (String) Any unique name for this widget (f.e. "MyButton1"). This is optional only. If not specified, Widget Candy applies a unique name automatically. Using names to identify widgets is very handy, since most Widget Candy commands require a widget's name instead of an object handle. Therefore, you are not forced to store a reference to a widget (which could cause garbage collection problems if you forget to set this reference to nil again). In short, you should prefer using widget names, not object handles.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;—————————————
parentGroup=	(window name or display group handle). Not to be confused with the .group property (see below). The parentGroup property specifies the widget's parent. If set to nil or not specified, the widget will be placed directly onto the stage (the screen). If you specify a display group handle, the widget will be inserted into that display group. If a window widget's name (in quotes) is specified, the widget will be inserted into the specified window.
NOTE: you should always use .parentGroup to place a widget inside a display group, not Corona's :insert or Gideros' :addChild methods.
———————————————
group =	(String) Use any unique name here (in quotes, for example "MyGroup1") to group several widgets together. Widgets sharing the same group name are considered to be grouped. Widget groups are used by border widgets, for example. If you specify a group name when adding a border widget, the border will be drawn around the entire widget group, not around a single widget only.
————————————
alpha =	(Number) Specifies the initial alpha value (transparency) of the widget. Possible values are from 0.0 (transparent) to 1.0 (opaque).
scale	(Number) Specifies the scale (size) of the widget graphics. Note, this scales the widget's graphics only, the widget's width or height remains unchanged. This is useful for universal builds that run on iPhone and iPad, for example. By applying a different scale to a widget you are able to compensate different screen sizes.
—————————————
 
scale =	(Number) Specifies the scale (size) of the widget graphics. Note, this scales the widget's graphics only, the widget's width or height remains unchanged. This is useful for universal builds that run on iPhone and iPad, for example. By applying a different scale to a widget you are able to compensate different screen sizes.
——————————————————————
zindex	=(Number) Specifies the depth or z-index where this widget should be inserted at, which is useful if you want the widget to appear in front of certain other widgets, but behind certain others. Use a value of 1 to insert the widget as the first child of it's parent (it will be drawn behind all other children of the same parent then).
—————————————————
icon =	(Number) Specifies the icon to be shown (if the widget provides any). Icons are displayed from an icon sheet graphic (specified in your theme's .lua file). The icon number is the frame number on the icon sheet that you want to be displayed as the widget's icon.
————————————————————————
 
iconSize	=(Number) Specifies the size of the icon, in pixels. If not specified, the default icon size as specified in the theme's .lua settings file is used.
———————————————
enabled	=(Boolean) Specifies if the widget is enabled (true) or disabled (false). Default is true. If a widget is disabled, it will not respond to user actions until it is enabled again. Disabled widgets are drawn as transparent (greyed out).
———————————————————
color =	(Array) Specify an array with three values here (red, green and blue) to apply an individual color to a widget. To apply a green color to a widget, use color = {0,1,0}, for example. To reset (remove) tinting for a widget again, set color to {1,1,1}.
—————————————————
textAlign =	(String) Specifies the widget's text (and icon) alignment. Possible values are "left", "center" and "right". Default is "left".
——————————————————
textColor	(Array) Specifies the widget's text color. If not specified, a theme's default text color as specified in the theme's lua file is applied. To apply a custom text color, pass an array that contains a red, green and blue amount (each within a range from 0 to 1): textColor = {1,.5,0}
——————————————————
fontSize	(Number) Specifies the widget's font size. If not specified, a theme's default font size as specified in the theme's lua file is applied.
————————————————
 
border	(Array) Adds a background color and a border around the widget, if specified. Pass an empty table { } to remove any existing border again. The array should be in this format: 
border = {type, cornerSize, strokeWidth, R1,G1,B1,A1, R2,G2,B2,A2}
type
Possible values are "inset", "outset", "shadow" or "normal". "inset" and "outset" create an inset our outset 3D-style border, "shadow" creates a shadow behind the widget and "normal" displays a simple border only.
If "shadow" is used, the parameters are different:
border = {"shadow", cornerSize, shadowOffset, shadowAlpha}, where shadowAlpha is a value from 0 (transparent) to 1 (opaque).
 
cornerSize
The size of the corners' rounding. Use a value of 1 to display sharp corners.
strokeWidth
The border's stroke width.
R1,G1,B1,A1
The red, green, blue and alpha value used for the background color (each one from 0 - 1).
R2,G2,B2,A2
The red, green, blue and alpha value used for the stroke color, each one from 0 - 1 (custom stroke color is only available with border type set to "normal").
————————————————————————-
bgImage	(Array) Applies a custom background image to the widget, if specified. Pass an empty table { } to remove any existing background image again. The array should be in this format: 
bgImage = {pathAndFileName, alpha, blendMode}
pathAndFileName - The file name of the image to use.
alpha - The image's alpha value (0-1)
blendMode - F.e. "add", "multiply" etc.
———————————————
fadeInTime	(Number)
If specified, the widget will fade in smoothly when created. Specifies the duration of the fade in effect in millisecs.
————————————————
tapSound	(Number) If you specify a sound ID here, this sound is played when the user taps on the widget. Sounds are specified in a theme's settings file, where the first sound specified there has the ID number 1, the second has the ID number 2 and so on. Use '0' to play no sound (when your app is muted, for example).
————————————————————
releaseSound	(Number) If you specify a sound ID here, this sound is played when the user tapped on the widget and releases his finger. Sounds are specified in a theme's settings file, where the first sound specified there has the ID number 1, the second has the ID number 2 and so on.
——————————————
changeSound	(Number) If you specify a sound ID here, this sound is played when the widget's state or value was changed (sliders, switches etc.). Sounds are specified in a theme's settings file, where the first sound specified there has the ID number 1, the second has the ID number 2 and so on.
———————————————
selectSound	(Number) If you specify a sound ID here, this sound is played when one of the widget's items was selected (list widget, for example). Sounds are specified in a theme's settings file, where the first sound specified there has the ID number 1, the second has the ID number 2 and so on.
****
.
 
 
 
 
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: 2
Date Added: 2018-01-10 04:31:53
Last Modified: 2018-01-10 09:54:13

Web Analytics