Display Object Factories (ssk.display.*)

(Each object below (except spinning circle) was created with a single function call.)

SSK versus Pure Corona SDK

SSK provides a set of improved factories to replace/extend (&rightarrow;) the traditional display.* factories:

ssk.display.newCircle() &rightarrow; display.newCircle()

ssk.display.newRect() &rightarrow; display.newRect()

ssk.display.newImage() &rightarrow; display.newImage()

ssk.display.newImageRect() &rightarrow; display.newImageRect()

The benefit of these factories over the traditional ones is that a display object can often be fully configured, colorized, have a body added, and even have listeners added, all in one easily-typed and legible function call.

Other Factories

This page (of the docs) only discusses the 'Standard Factories', however ssk.diplay.* also has these factories: Arcs, Lines, Quick Layers

Visual Parameters (visualParams)

The first (common) table that all of these builders takes is the visualParams table. With this table, you can set almost all visual properties on the object and you can also attach or set any arbitrary property.

visualParams - 'Standard' Properties

Aside from the 'custom' and specially handled properties listed above, you may set any normal Corona property as well.

The sample above creates a white circle with a radius of 20 pixels on the very left-edge of the screen and vertically centered.

As soon as is created, the circle immediately starts moving one pixel to the right every frame.

Once has reached the right-edge of the screen it will stop and remove the listener.

visualParams - 'Arbitrary' Properties

Lastly, as you may have noticed in the prior section, visualParams can take any arbitrary property name and assign a value to it. This is extremely handy for setting flags and other values used later in your code.