VIVE

Posted by Caleb P, Posted on May 21, 2013

0 votes

VIVE
Versatile Independent Variable Encoder
(rhymes with "hive")

An easy, reliable, and flexible way to convert tables to strings and vice-versa.

Supports keys of type "string" or "number"
Supports values of type "string", "number", "boolean", or "table".

What is VIVE?

Easy setFillColor Transition

Posted by bfintal, Posted on April 16, 2013

0 votes

Here're 2 small self-contained functions you can use to perform a smooth transition for fillcolors:

Usage:

Initially set a fill color via: (We need this so that we can know what the color to transition FROM is)

1
2
local g = display.newRect(0, 0, 100, 100)
setFillColor(78, 186, 248)

Then just call the set fill color transition via:

1
2
-- sets the color of 'g' to {255, 128, 0} for 3000 milliseconds
setFillColorTransition(g, 255, 128, 0, 3000)

CBResources

Posted by Caleb P, Posted on March 20, 2013, Last updated April 6, 2013

1 vote

After much work, CBResources has just been finished.

Includes a manual, reference, bragging rights, sample browser app, roadmap, info, and the old, outdated previous samples.

To run the sample app, you'll need to copy CBEffects into the CBResources root folder.

Edit Apr. 6: Supports Widget 2.0

Enjoy!

Caleb

Get it from Gymbyl

GridView for Corona SDK

Posted by shihhsin, Posted on March 17, 2013

2 votes
GitHub URL: 
https://github.com/worldstar/GridView-for-Corona-SDK

This UI is used to show a GridView on the screen, which is sort of a photo album.

It could show the figure as buttons, and labels on each figures.

In addition, the label length is adjusted when the string length is longer than the figure width.

You can control the GridView position, and how many columns are shown in each row.

Go ahead to apply this library in your project.

Only few line, you can show the GridView perfectly.
 

Switch physics display mode on device

Posted by horacebury, Posted on March 13, 2013

0 votes

If you want to switch between normal and hybrid physics mode on your device using a shake is a good way to do this without needing to use an on-screen button, which would need to be taken out later...

1
2
3
4
5
6
7
8
9
10
11
12
13
14
-- switches physics mode easily on device
local hybridon = true
function jerk(e)
        if (e.isShake) then
                hybridon = not hybridon
                if (hybridon) then
                        physics.setDrawMode("hybrid")
                else
                        physics.setDrawMode("normal")
                end
        end
        return true
end
Runtime:addEventListener("accelerometer",jerk)

Sidebar UI example

Posted by chevol, Posted on March 3, 2013

3 votes

This is a quick and nasty demo of a sidebar UI like Facebook. This code was done quickly just to show the basic concept and not to be used in production. The idea is for people to understand the concept and expand on it, creating their own version with better/more finalized code. I have seen comments in the forums on if this was possible so here is just a small demo with some code to show that it is possible. Hopefully someone with more time then I have can create a nice framework for the community.

Here is a short video of it in action:
http://youtu.be/nsE_mwKW4pM

newtext align right ( it works ! )

Posted by romanfischer, Posted on February 28, 2013

0 votes

This is a modified version of the newretinatext function from the beebegames-class ( http://developer.coronalabs.com/code/beebegames-class ).
This function aligns every font in every size without gaps, leaps... to the right ( what we would like to have from setreferencepoint( display.CenterRightReferencePoint).

The original class wasn't working properly for me. but it brought me on the right track. see for yourself.

I've added an extra parameter for vertical alignment ( top and center )
regarding the options for horizontal alignment only right alignment is possible so far.

 

Barcode Scanning w/Pic2Shop

Posted by Minion Multimiedia, Posted on February 19, 2013, Last updated February 20, 2013

0 votes
GitHub URL: 
https://github.com/comp1400/Barcode-Scanning-with-Corona-SDK-and-Pic2Shop.git

Shows how to integrate Pic2Shop barcode scanning. (iOS for the time being)

build.settings

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
-- cpmgen build.settings
settings =
{
        orientation =
        {
                default ="portrait",
                content = "portrait",
                supported =
                {
                        "portrait"
                },
        },
 
        iphone =
        {
                plist =
                {
                        UIFileSharingEnabled = true,
            CFBundleURLTypes =
            {
                {
                                        CFBundleURLName = "com.SomethingHere.yourapp",
                    CFBundleURLSchemes =
                    {
                        "yourapp",
                    }
                }

User rating by a 5-star view library

Posted by shihhsin, Posted on February 15, 2013

1 vote
GitHub URL: 
https://github.com/worldstar/StarView.git

Because Corona SDK has not supported the rating view, I create a library named starView to do that job. It is quite simple to apply this library in three lines. First, we include the starView library in the program.

1
        local starsView = require("starsView")

Then, we initialize the starView object. The parameters are the x, y, initial star numbers, and is editable of the starView. You could see the starView could work well now.

1
        starsView:new(200, 150, 4, true)

Finally, you could get the result by the following code.
 

Super Simple and Freakishly Fast Bitmap mask creation for ScrollView using ImageMagick

Posted by james03, Posted on February 5, 2013

0 votes

So you want a scrollView that only takes up some of the screen?
You'll need a bitmap mask, which is pretty easy to create using your favourite GUI tool but not that quick and if you don't have or know your way around photoshop or GIMP somewhat daunting.
But if you have ImageMagick installed you can do it in one line from the command line:

For a scrollView W x H:

1
convert -size W+4xH+4 xc:black -fill white -draw "rectangle 2,2 W+1,H+1" mask-WxH.png

Example for a scrollview that takes up half the screen in portrait mode, i.e. 320x240: