This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
------------------------------------------------------------------------------------------------------------------------ | |
--Convex Separator for Box2D Flash for Corona SDK | |
--The original class has been written by Antoan Angelov. | |
--This LUA port was done by Ragdog Studios SRL (http://www.ragdogstudios.com) | |
--It is designed to work with Erin Catto's Box2D physics library implementation in Corona SDK (http://www.coronalabs.com) | |
--Everybody can use this software for any purpose, under two restrictions: | |
--1. You cannot claim that you wrote this software. | |
--2. You cannot remove or alter this notice. | |
--How to use it: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[email protected] | |
--M.I.T. license | |
physics=require ("physics") | |
physics.start() | |
physics.setGravity(0,0) | |
local noObject = true | |
local function create() | |
local vertices = { 0,-110, 27,-35, 105,-35, 43,16, 65,90, 0,45, -65,90, -43,15, -105,-35, -27,-35 } | |
local r, g, b = math.random(),math.random(),math.random() | |
local o = display.newPolygon( 0, 0, vertices ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SeekBarWithIntervals extends LinearLayout { | |
private LinearLayout mLinearLayout = null; | |
private SeekBar mSeekBar = null; | |
private int WidthMeasureSpec = 0; | |
private int HeightMeasureSpec = 0; | |
public SeekBarWithIntervals(Context context, AttributeSet attributeSet) { | |
super(context, attributeSet); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Corona Game SDK example of how to let two bodies circle each other by applying a continuous, attracting force | |
-- | |
-- The example uses the physics engine, sets gravity to 0, creates two balls separated in the x-direction, | |
-- with initial speeds in opposite y-direction. | |
-- Thru an enterFrame event handler, an attracting force is continuously applied to both balls with body:applyForce(). | |
-- The force is normalized over the distance between the two balls. | |
-- By playing with the initial speed and force factors, you can make the balls spin faster/slower in circles or ellipses | |
-- | |
-- Save this file as "main.lua" in a project directory and load it in the simulator | |
-- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
----------------------------------------------------------------------------------------- | |
-- | |
-- modal.lua | |
-- | |
-- Modal dialog for Corona SDK | |
-- V. Sergeyev | |
-- | |
-- Usage: | |
-- showDialog("You completed the level. \n1st place.", "Next level", "level2", beforeNext) | |
-- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- arrow test | |
-- http://www.iforce2d.net/b2dtut/sticky-projectiles | |
-- video: http://screencast.com/t/vcPLSJR6xkIq | |
require("mathlib") | |
local sWidth, sHeight = display.actualContentWidth, display.actualContentHeight | |
local centerX, centerY = sWidth/2, sHeight/2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- swipe library | |
--[[ Libraries ]]-- | |
local composer = require("composer") | |
--[[ Fields ]]-- | |
local mainstage = display.getCurrentStage() | |
local stage = composer.stage |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- polygon concave test | |
require("mathlib") | |
stage = display.getCurrentStage() | |
local text = display.newText{ text="- - -", x=display.contentCenterX, y=100, fontSize=24 } | |
lines = display.newGroup() | |
lines:insert(display.newGroup()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window = UIWindow(frame: UIScreen.mainScreen().bounds) | |
if let window = window { | |
window.backgroundColor = UIColor.whiteColor() | |
window.rootViewController = UIViewController() | |
window.makeKeyAndVisible() | |
} |
OlderNewer