Code Monkey home page Code Monkey logo

gridview-for-corona-sdk's Introduction

GridView-for-Corona-SDK

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.

--Include the gridView library
local gridView = require("gridView")

--Data
local photoArray = {"assets/pic1.png","assets/pic2.png","assets/pic3.png","assets/pic4.png","assets/pic5.png"}
local photoTextArray = {"pic1","pic2","pic3","pic4","pic5  Long Text Test"}

--Process the event when user click on the grid
local function gridListener(index)
	print("You select item "..index)
end

--Initialize the starView object. The parameters are the gridX, gridY, photoArray, photoTextArray, columnNumber, paddingX, paddingY, photoWidth, photoHeight, gridListener.
gridView:new(50, 100, photoArray, photoTextArray, 2, 10, 20, 214, 156, gridListener)

Note: If you use the Widget V2.0, please edit the gridView.lua and then change the default to defaultFile for the button widget.

gridview-for-corona-sdk's People

Contributors

worldstar avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.