added new example

This commit is contained in:
Paul Colton
2013-09-04 11:31:05 -07:00
parent d4d9dfe17f
commit 821c418936
10 changed files with 101 additions and 0 deletions

16
Examples/HelloWorld/.gitignore vendored Normal file
View File

@@ -0,0 +1,16 @@
.repl_history
build
tags
app/pixate_code.rb
resources/*.nib
resources/*.momd
resources/*.storyboardc
.DS_Store
nbproject
.redcar
#*#
*~
*.sw[po]
.eprj
.sass-cache
.idea

View File

@@ -0,0 +1,8 @@
source 'https://rubygems.org'
gem 'rake'
# Add your dependencies here:
gem 'motion-pixate'

View File

@@ -0,0 +1,14 @@
GEM
remote: https://rubygems.org/
specs:
motion-pixate (1.3)
sass
rake (10.1.0)
sass (3.2.10)
PLATFORMS
ruby
DEPENDENCIES
motion-pixate
rake

View File

@@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
$:.unshift("/Library/RubyMotion/lib")
require 'motion/project/template/ios'
require 'rubygems'
require 'motion-pixate'
begin
require 'bundler'
Bundler.require
rescue LoadError
end
Motion::Project::App.setup do |app|
# Use `rake config' to see complete project settings.
app.name = 'HelloWorld'
app.pixate.key = 'KEY CODE'
app.pixate.user = 'USER ID'
app.pixate.framework = 'vendor/PXEngine.framework'
end

View File

@@ -0,0 +1,12 @@
class AppDelegate
def application(application, didFinishLaunchingWithOptions:launchOptions)
@window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds)
@window.rootViewController = HelloWorldController.alloc.init
@window.rootViewController.wantsFullScreenLayout = true
@window.styleMode = PXStylingNormal
@window.makeKeyAndVisible
true
end
end

View File

@@ -0,0 +1,12 @@
class HelloWorldController < UIViewController
def viewDidLoad
margin = 20
@button = UIButton.buttonWithType(UIButtonTypeCustom)
@button.frame = [[margin, 260], [view.frame.size.width - margin * 2, 40]]
view.addSubview(@button)
view.styleId = "myView"
end
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -0,0 +1,10 @@
button {
text: Pixate Says Hello!;
background-image: linear-gradient(blue, lightblue);
border-radius: 10px;
}
#myView {
background-image: linear-gradient(white, gray);
}

View File

@@ -0,0 +1,9 @@
describe "Application 'HelloWorld'" do
before do
@app = UIApplication.sharedApplication
end
it "has one window" do
@app.windows.size.should == 1
end
end

View File

@@ -0,0 +1 @@
/Users/pcolton/Library/Developer/Xcode/DerivedData/Pixate_Engine-cxbqfllitlqcspcaxewxldmpknhu/Build/Products/Debug-iphonesimulator/PXEngine.framework