Gideros Ace Snow object creates a falling snowflake effect for your application window.

It is possible to set quantity and speed of flakes, and also provide image of custom snowflake. This object also provides methods to start or stop snowing and add flakes.

Package contains Ace.snow.lua and example Gideros application project.

Contents

Download

Example codes

Snow.init({
	image = 'images/snowflake.png',
	fallingTime = 20000,
	flakeInterval = 600,
	flakeSize = 20,
	sizeDelta = 5,
	easing = easing.outSine,
	fadeOut = true,
	shrink = true,
	rotate = true,
	autoStart = true,
	parent = stage
})

Example video

Video of module example app:

Method list

Constructor

Back to method list

Method nameinit(config);
DescriptionInitialize snow module
Input parameters

table config - lua table with configuration properties

  • string image - path for snowflake image (default: none)
  • int fallingTime - time in miliseconds for one snowflake to fall (default: 20000)
  • int flakeInterval - time in miliseconds between new snowflakes appearing (default: 800)
  • int flakeSize - average snowflake size in pixels (default: 10)
  • int sizeDelta - difference from average snowflake size for smaller and greater snwoflakes (default: 5)
  • easing - easing function from easing.lua (default: no easing (linear))
  • bool fadeOut - should snow flakes fade out while falling (default: true)
  • bool shrink - should snow flakes shrink while falling (default: true)
  • bool rotate - should snow flakes rotate while falling (default: true)
  • bool autoStart - should snow start automatically (default: true)
  • object parent - where to add snow (default: stage)
Example input
Snow.init({image = "snowflake.png"})

Start snow

Back to method list

Method namestart()
DescriptionStart snowing if sowing was stopped or wasn't started automatically

Stop snow

Back to method list

Method namestop()
DescriptionStop new flakes from appearing

Add flake

Back to method list

Method nameaddFlake()
DescriptionSnow flakes will appear automatically based on provided configuration, but it is possible to add additional snowflakes using this method

Latest changes

None for now