coronate 0.0.3 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/README.md +24 -6
- data/bin/coronate +2 -1
- data/lib/coronate/builder/app_builder.rb +27 -0
- data/lib/coronate/builder/ebook_builder.rb +25 -0
- data/lib/coronate/builder/game_builder.rb +25 -0
- data/lib/coronate/builder/project_builder.rb +21 -0
- data/lib/coronate/builder/scene_builder.rb +13 -0
- data/lib/coronate/builder/templates/app/build.settings.tt +41 -0
- data/lib/coronate/builder/templates/app/config.lua.tt +29 -0
- data/lib/coronate/builder/templates/app/icon1-down.png +0 -0
- data/lib/coronate/builder/templates/app/icon1-down@2x.png +0 -0
- data/lib/coronate/builder/templates/app/icon1.png +0 -0
- data/lib/coronate/builder/templates/app/icon1@2x.png +0 -0
- data/lib/coronate/builder/templates/app/icon2-down.png +0 -0
- data/lib/coronate/builder/templates/app/icon2-down@2x.png +0 -0
- data/lib/coronate/builder/templates/app/icon2.png +0 -0
- data/lib/coronate/builder/templates/app/icon2@2x.png +0 -0
- data/lib/coronate/builder/templates/app/main.lua.tt +39 -0
- data/lib/coronate/builder/templates/app/view1.lua.tt +88 -0
- data/lib/coronate/builder/templates/app/view2.lua.tt +89 -0
- data/lib/coronate/builder/templates/ebook/build.settings.tt +41 -0
- data/lib/coronate/builder/templates/ebook/config.lua.tt +29 -0
- data/lib/coronate/builder/templates/ebook/coronaicon-big.png +0 -0
- data/lib/coronate/builder/templates/ebook/cover.jpg +0 -0
- data/lib/coronate/builder/templates/ebook/main.lua.tt +14 -0
- data/lib/coronate/builder/templates/ebook/moon.png +0 -0
- data/lib/coronate/builder/templates/ebook/page1.lua.tt +225 -0
- data/lib/coronate/builder/templates/ebook/pagebg1.png +0 -0
- data/lib/coronate/builder/templates/ebook/space.jpg +0 -0
- data/lib/coronate/builder/templates/ebook/sun.png +0 -0
- data/lib/coronate/builder/templates/ebook/title.lua.tt +97 -0
- data/lib/coronate/builder/templates/game/background.jpg +0 -0
- data/lib/coronate/builder/templates/game/build.settings.tt +41 -0
- data/lib/coronate/builder/templates/game/button-over.png +0 -0
- data/lib/coronate/builder/templates/game/button.png +0 -0
- data/lib/coronate/builder/templates/game/config.lua.tt +29 -0
- data/lib/coronate/builder/templates/game/crate.png +0 -0
- data/lib/coronate/builder/templates/game/grass.png +0 -0
- data/lib/coronate/builder/templates/game/level1.lua.tt +102 -0
- data/lib/coronate/builder/templates/game/logo.png +0 -0
- data/lib/coronate/builder/templates/game/main.lua.tt +14 -0
- data/lib/coronate/builder/templates/game/menu.lua.tt +115 -0
- data/lib/coronate/{templates → builder/templates/project}/build.settings.tt +0 -0
- data/lib/coronate/{templates → builder/templates/project}/config.tt +15 -0
- data/lib/coronate/{templates → builder/templates/project}/endingScene.tt +0 -0
- data/lib/coronate/{templates → builder/templates/project}/main.tt +0 -0
- data/lib/coronate/{templates → builder/templates/project}/menuScene.tt +0 -0
- data/lib/coronate/{templates → builder/templates/project}/settingsScene.tt +0 -0
- data/lib/coronate/{templates → builder/templates/project}/titleScene.tt +0 -0
- data/lib/coronate/{templates → builder/templates/project}/utils.tt +0 -0
- data/lib/coronate/builder/templates/scene/scene.tt +148 -0
- data/lib/coronate/cli.rb +56 -17
- metadata +51 -11
- data/lib/coronate/templates/scene.tt +0 -82
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MzEwYTQ2MzcyOWFiM2E1NDc0OWE4NjlhM2I3YmNjZDYzNDEyMTZiNA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YTM3NjM5MmY1ZWEwNjlkMTg1MGI1MjVlYzkwNzIwYTMyMTFhNzA0OQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZWExNzBjNTVlMzM3MjExNjdlM2IxMGI4YmQ1NDQ0ZTcyN2ZjZTcyODQzYTQ2
|
10
|
+
ZGIxNzZhYmZmNjdlYTY4ZmNlNjQwYjg4NDEzN2U2NjAzZmMxZDVlZDZmMDkw
|
11
|
+
N2I1NmU2NWFjNzgxNWEzNjc0NzczMmRmNzM4NmExMjQ5ZjJiNDQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MWViMjUxNGQxMjQ2Yjg5Mzg4NGZjOWRkMjczZTE0MWFjMjQwMjQ3YjIzODNh
|
14
|
+
MDA0MDVmNTA0M2I3ODgxOGQzNzZlYjUzY2RjMDY2ZDE4MWIxOWJjMjg2OGJm
|
15
|
+
ZmRmN2U4MWZkYTI5ODQ4NGVmNWUzZTE3ZGQ2NTdhMDI1MTdjZTc=
|
data/README.md
CHANGED
@@ -8,15 +8,33 @@
|
|
8
8
|
### Help
|
9
9
|
|
10
10
|
$ coronate
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
11
|
+
Commands:
|
12
|
+
coronate app [NAME] # generate a corona app project
|
13
|
+
coronate ebook [NAME] # generate a corona ebook project
|
14
|
+
coronate game [NAME] # generate a corona game project
|
15
|
+
coronate help [COMMAND] # Describe available commands or one specific command
|
16
|
+
coronate project [NAME] # generate a corona project
|
17
|
+
coronate scene [NAME] # generate an scene
|
15
18
|
|
16
|
-
### Generate
|
19
|
+
### Generate a corona blank project
|
17
20
|
|
18
21
|
$ cb project helloworld # default width=320 height=480 orientation=landscape
|
19
|
-
$ cb project helloworld -w 320 -h 568 --no-landscape # width=320 height=568 orientation=portrait
|
22
|
+
$ cb project helloworld -w 320 -h 568 --no-landscape # width=320 height=568 orientation=portrait
|
23
|
+
|
24
|
+
### Generate a corona game project
|
25
|
+
|
26
|
+
$ cb game hellogame # default width=320 height=480 orientation=landscape
|
27
|
+
$ cb game hellogame -w 320 -h 568 --no-landscape # width=320 height=568 orientation=portrait
|
28
|
+
|
29
|
+
### Generate a corona ebook project
|
30
|
+
|
31
|
+
$ cb ebook helloebook # default width=320 height=480 orientation=landscape
|
32
|
+
$ cb ebook helloebook -w 320 -h 568 --no-landscape # width=320 height=568 orientation=portrait
|
33
|
+
|
34
|
+
### Generate a corona app project
|
35
|
+
|
36
|
+
$ cb app helloapp # default width=320 height=480 orientation=landscape
|
37
|
+
$ cb app helloapp -w 320 -h 568 --no-landscape # width=320 height=568 orientation=portrait
|
20
38
|
|
21
39
|
### Generate a scene file
|
22
40
|
|
data/bin/coronate
CHANGED
@@ -0,0 +1,27 @@
|
|
1
|
+
module Coronate
|
2
|
+
module Builder
|
3
|
+
module AppBuilder
|
4
|
+
|
5
|
+
def build_app(options={})
|
6
|
+
@name, @width, @height = options[:name], options[:width], options[:height]
|
7
|
+
@orient = if options[:landscape] then %{ "landscapeLeft", "landscapeRight" } else %{ "portrait", "portraitUpsideDown" } end
|
8
|
+
|
9
|
+
template 'builder/templates/app/build.settings.tt', "#{@name}/build.settings"
|
10
|
+
template 'builder/templates/app/config.lua.tt', "#{@name}/config.lua"
|
11
|
+
template 'builder/templates/app/view1.lua.tt', "#{@name}/view1.lua"
|
12
|
+
template 'builder/templates/app/view2.lua.tt', "#{@name}/view2.lua"
|
13
|
+
template 'builder/templates/app/main.lua.tt', "#{@name}/main.lua"
|
14
|
+
|
15
|
+
copy_file 'builder/templates/app/icon1-down.png', "#{@name}/icon1-down.png"
|
16
|
+
copy_file 'builder/templates/app/icon1-down@2x.png', "#{@name}/icon1-down@2x.png"
|
17
|
+
copy_file 'builder/templates/app/icon2-down.png', "#{@name}/icon2-down.png"
|
18
|
+
copy_file 'builder/templates/app/icon2-down@2x.png', "#{@name}/icon2-down@2x.png"
|
19
|
+
copy_file 'builder/templates/app/icon1.png', "#{@name}/icon1.png"
|
20
|
+
copy_file 'builder/templates/app/icon1@2x.png', "#{@name}/icon1@2x.png"
|
21
|
+
copy_file 'builder/templates/app/icon2.png', "#{@name}/icon2.png"
|
22
|
+
copy_file 'builder/templates/app/icon2@2x.png', "#{@name}/icon2@2x.png"
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module Coronate
|
2
|
+
module Builder
|
3
|
+
module EbookBuilder
|
4
|
+
|
5
|
+
def build_ebook(options={})
|
6
|
+
@name, @width, @height = options[:name], options[:width], options[:height]
|
7
|
+
@orient = if options[:landscape] then %{ "landscapeLeft", "landscapeRight" } else %{ "portrait", "portraitUpsideDown" } end
|
8
|
+
|
9
|
+
template 'builder/templates/ebook/build.settings.tt', "#{@name}/build.settings"
|
10
|
+
template 'builder/templates/ebook/title.lua.tt', "#{@name}/title.lua"
|
11
|
+
template 'builder/templates/ebook/config.lua.tt', "#{@name}/config.lua"
|
12
|
+
template 'builder/templates/ebook/main.lua.tt', "#{@name}/main.lua"
|
13
|
+
template 'builder/templates/ebook/page1.lua.tt', "#{@name}/page1.lua"
|
14
|
+
|
15
|
+
copy_file 'builder/templates/ebook/coronaicon-big.png', "#{@name}/coronaicon-big.png"
|
16
|
+
copy_file 'builder/templates/ebook/cover.jpg', "#{@name}/cover.jpg"
|
17
|
+
copy_file 'builder/templates/ebook/moon.png', "#{@name}/moon.png"
|
18
|
+
copy_file 'builder/templates/ebook/pagebg1.png', "#{@name}/pagebg1.png"
|
19
|
+
copy_file 'builder/templates/ebook/space.jpg', "#{@name}/space.jpg"
|
20
|
+
copy_file 'builder/templates/ebook/sun.png', "#{@name}/sun.png"
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module Coronate
|
2
|
+
module Builder
|
3
|
+
module GameBuilder
|
4
|
+
|
5
|
+
def build_game(options={})
|
6
|
+
@name, @width, @height = options[:name], options[:width], options[:height]
|
7
|
+
@orient = if options[:landscape] then %{ "landscapeLeft", "landscapeRight" } else %{ "portrait", "portraitUpsideDown" } end
|
8
|
+
|
9
|
+
template 'builder/templates/game/build.settings.tt', "#{@name}/build.settings"
|
10
|
+
template 'builder/templates/game/config.lua.tt', "#{@name}/config.lua"
|
11
|
+
template 'builder/templates/game/main.lua.tt', "#{@name}/main.lua"
|
12
|
+
template 'builder/templates/game/menu.lua.tt', "#{@name}/menu.lua"
|
13
|
+
template 'builder/templates/game/level1.lua.tt', "#{@name}/level1.lua"
|
14
|
+
|
15
|
+
copy_file 'builder/templates/game/background.jpg', "#{@name}/background.jpg"
|
16
|
+
copy_file 'builder/templates/game/button-over.png', "#{@name}/button-over.png"
|
17
|
+
copy_file 'builder/templates/game/button.png', "#{@name}/button.png"
|
18
|
+
copy_file 'builder/templates/game/crate.png', "#{@name}/crate.png"
|
19
|
+
copy_file 'builder/templates/game/grass.png', "#{@name}/grass.png"
|
20
|
+
copy_file 'builder/templates/game/logo.png', "#{@name}/logo.png"
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Coronate
|
2
|
+
module Builder
|
3
|
+
module ProjectBuilder
|
4
|
+
|
5
|
+
def build_project(options={})
|
6
|
+
@name, @width, @height = options[:name], options[:width], options[:height]
|
7
|
+
@orient = if options[:landscape] then %{ "landscapeLeft", "landscapeRight" } else %{ "portrait", "portraitUpsideDown" } end
|
8
|
+
empty_directory "#{@name}/assets"
|
9
|
+
template 'builder/templates/project/main.tt', "#{@name}/main.lua"
|
10
|
+
template 'builder/templates/project/utils.tt', "#{@name}/utils.lua"
|
11
|
+
template 'builder/templates/project/titleScene.tt', "#{@name}/titleScene.lua"
|
12
|
+
template 'builder/templates/project/endingScene.tt', "#{@name}/endingScene.lua"
|
13
|
+
template 'builder/templates/project/settingsScene.tt', "#{@name}/settingsScene.lua"
|
14
|
+
template 'builder/templates/project/menuScene.tt', "#{@name}/menuScene.lua"
|
15
|
+
template 'builder/templates/project/config.tt', "#{@name}/config.lua"
|
16
|
+
template 'builder/templates/project/build.settings.tt', "#{@name}/build.settings"
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module Coronate
|
2
|
+
module Builder
|
3
|
+
module SceneBuilder
|
4
|
+
|
5
|
+
def build_scene(options={})
|
6
|
+
@name, @width, @height = options[:name], options[:width], options[:height]
|
7
|
+
@orient = if options[:landscape] then %{ "landscapeLeft", "landscapeRight" } else %{ "portrait", "portraitUpsideDown" } end
|
8
|
+
template 'builder/templates/scene/scene.tt', "#{name}.lua"
|
9
|
+
end
|
10
|
+
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
-- Supported values for orientation:
|
2
|
+
-- portrait, portraitUpsideDown, landscapeLeft, landscapeRight
|
3
|
+
|
4
|
+
settings = {
|
5
|
+
|
6
|
+
orientation = {
|
7
|
+
default = { <%= @orient %> },
|
8
|
+
supported = { <%= @orient %> }
|
9
|
+
},
|
10
|
+
|
11
|
+
iphone = {
|
12
|
+
plist = {
|
13
|
+
UIStatusBarHidden = false,
|
14
|
+
UIPrerenderedIcon = true, -- set to false for "shine" overlay
|
15
|
+
--UIApplicationExitsOnSuspend = true, -- uncomment to quit app on suspend
|
16
|
+
|
17
|
+
--[[
|
18
|
+
-- iOS app URL schemes:
|
19
|
+
CFBundleURLTypes =
|
20
|
+
{
|
21
|
+
{
|
22
|
+
CFBundleURLSchemes =
|
23
|
+
{
|
24
|
+
"fbXXXXXXXXXXXXXX", -- example scheme for facebook
|
25
|
+
"coronasdkapp", -- example second scheme
|
26
|
+
}
|
27
|
+
}
|
28
|
+
}
|
29
|
+
--]]
|
30
|
+
}
|
31
|
+
},
|
32
|
+
|
33
|
+
--[[
|
34
|
+
-- Android permissions
|
35
|
+
|
36
|
+
androidPermissions = {
|
37
|
+
"android.permission.INTERNET",
|
38
|
+
},
|
39
|
+
|
40
|
+
]]--
|
41
|
+
}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
application = {
|
2
|
+
content = {
|
3
|
+
width = <%= @width %>,
|
4
|
+
height = <%= @height %>,
|
5
|
+
scale = "letterBox",
|
6
|
+
fps = 30,
|
7
|
+
|
8
|
+
--[[
|
9
|
+
imageSuffix = {
|
10
|
+
["@2x"] = 2,
|
11
|
+
}
|
12
|
+
--]]
|
13
|
+
},
|
14
|
+
|
15
|
+
--[[
|
16
|
+
-- Push notifications
|
17
|
+
|
18
|
+
notification =
|
19
|
+
{
|
20
|
+
iphone =
|
21
|
+
{
|
22
|
+
types =
|
23
|
+
{
|
24
|
+
"badge", "sound", "alert", "newsstand"
|
25
|
+
}
|
26
|
+
}
|
27
|
+
}
|
28
|
+
--]]
|
29
|
+
}
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,39 @@
|
|
1
|
+
-----------------------------------------------------------------------------------------
|
2
|
+
--
|
3
|
+
-- main.lua
|
4
|
+
--
|
5
|
+
-----------------------------------------------------------------------------------------
|
6
|
+
|
7
|
+
-- show default status bar (iOS)
|
8
|
+
display.setStatusBar( display.DefaultStatusBar )
|
9
|
+
|
10
|
+
-- include Corona's "widget" library
|
11
|
+
local widget = require "widget"
|
12
|
+
local storyboard = require "storyboard"
|
13
|
+
|
14
|
+
|
15
|
+
-- event listeners for tab buttons:
|
16
|
+
local function onFirstView( event )
|
17
|
+
storyboard.gotoScene( "view1" )
|
18
|
+
end
|
19
|
+
|
20
|
+
local function onSecondView( event )
|
21
|
+
storyboard.gotoScene( "view2" )
|
22
|
+
end
|
23
|
+
|
24
|
+
|
25
|
+
-- create a tabBar widget with two buttons at the bottom of the screen
|
26
|
+
|
27
|
+
-- table to setup buttons
|
28
|
+
local tabButtons = {
|
29
|
+
{ label="First", defaultFile = "icon1.png", overFile = "icon1-down.png", width = 32, height = 32, onPress=onFirstView, selected=true },
|
30
|
+
{ label="Second", defaultFile = "icon2.png", overFile = "icon2-down.png", width = 32, height = 32, onPress=onSecondView },
|
31
|
+
}
|
32
|
+
|
33
|
+
-- create the actual tabBar widget
|
34
|
+
local tabBar = widget.newTabBar{
|
35
|
+
top = display.contentHeight - 50, -- 50 is default height for tabBar widget
|
36
|
+
buttons = tabButtons
|
37
|
+
}
|
38
|
+
|
39
|
+
onFirstView() -- invoke first tab button's onPress event manually
|
@@ -0,0 +1,88 @@
|
|
1
|
+
-----------------------------------------------------------------------------------------
|
2
|
+
--
|
3
|
+
-- view1.lua
|
4
|
+
--
|
5
|
+
-----------------------------------------------------------------------------------------
|
6
|
+
|
7
|
+
local storyboard = require( "storyboard" )
|
8
|
+
local scene = storyboard.newScene()
|
9
|
+
|
10
|
+
-----------------------------------------------------------------------------------------
|
11
|
+
-- BEGINNING OF YOUR IMPLEMENTATION
|
12
|
+
--
|
13
|
+
-- NOTE: Code outside of listener functions (below) will only be executed once,
|
14
|
+
-- unless storyboard.removeScene() is called.
|
15
|
+
--
|
16
|
+
-----------------------------------------------------------------------------------------
|
17
|
+
|
18
|
+
-- Called when the scene's view does not exist:
|
19
|
+
function scene:createScene( event )
|
20
|
+
local group = self.view
|
21
|
+
|
22
|
+
-- create a white background to fill screen
|
23
|
+
local bg = display.newRect( 0, 0, display.contentWidth, display.contentHeight )
|
24
|
+
bg:setFillColor( 255 ) -- white
|
25
|
+
|
26
|
+
-- create some text
|
27
|
+
local title = display.newText( "First View", 0, 0, native.systemFont, 32 )
|
28
|
+
title:setTextColor( 0 ) -- black
|
29
|
+
title:setReferencePoint( display.CenterReferencePoint )
|
30
|
+
title.x = display.contentWidth * 0.5
|
31
|
+
title.y = 125
|
32
|
+
|
33
|
+
local summary = display.newText( "Loaded by the first tab 'onPress' listener\n— specified in the 'tabButtons' table.", 0, 0, 300, 300, native.systemFont, 14 )
|
34
|
+
summary:setTextColor( 0 ) -- black
|
35
|
+
summary:setReferencePoint( display.CenterReferencePoint )
|
36
|
+
summary.x = display.contentWidth * 0.5 + 10
|
37
|
+
summary.y = title.y + 215
|
38
|
+
|
39
|
+
-- all objects must be added to group (e.g. self.view)
|
40
|
+
group:insert( bg )
|
41
|
+
group:insert( title )
|
42
|
+
group:insert( summary )
|
43
|
+
end
|
44
|
+
|
45
|
+
-- Called immediately after scene has moved onscreen:
|
46
|
+
function scene:enterScene( event )
|
47
|
+
local group = self.view
|
48
|
+
|
49
|
+
-- Do nothing
|
50
|
+
end
|
51
|
+
|
52
|
+
-- Called when scene is about to move offscreen:
|
53
|
+
function scene:exitScene( event )
|
54
|
+
local group = self.view
|
55
|
+
|
56
|
+
-- INSERT code here (e.g. stop timers, remove listenets, unload sounds, etc.)
|
57
|
+
|
58
|
+
end
|
59
|
+
|
60
|
+
-- If scene's view is removed, scene:destroyScene() will be called just prior to:
|
61
|
+
function scene:destroyScene( event )
|
62
|
+
local group = self.view
|
63
|
+
|
64
|
+
-- INSERT code here (e.g. remove listeners, remove widgets, save state variables, etc.)
|
65
|
+
|
66
|
+
end
|
67
|
+
|
68
|
+
-----------------------------------------------------------------------------------------
|
69
|
+
-- END OF YOUR IMPLEMENTATION
|
70
|
+
-----------------------------------------------------------------------------------------
|
71
|
+
|
72
|
+
-- "createScene" event is dispatched if scene's view does not exist
|
73
|
+
scene:addEventListener( "createScene", scene )
|
74
|
+
|
75
|
+
-- "enterScene" event is dispatched whenever scene transition has finished
|
76
|
+
scene:addEventListener( "enterScene", scene )
|
77
|
+
|
78
|
+
-- "exitScene" event is dispatched whenever before next scene's transition begins
|
79
|
+
scene:addEventListener( "exitScene", scene )
|
80
|
+
|
81
|
+
-- "destroyScene" event is dispatched before view is unloaded, which can be
|
82
|
+
-- automatically unloaded in low memory situations, or explicitly via a call to
|
83
|
+
-- storyboard.purgeScene() or storyboard.removeScene().
|
84
|
+
scene:addEventListener( "destroyScene", scene )
|
85
|
+
|
86
|
+
-----------------------------------------------------------------------------------------
|
87
|
+
|
88
|
+
return scene
|
@@ -0,0 +1,89 @@
|
|
1
|
+
-----------------------------------------------------------------------------------------
|
2
|
+
--
|
3
|
+
-- view2.lua
|
4
|
+
--
|
5
|
+
-----------------------------------------------------------------------------------------
|
6
|
+
|
7
|
+
local storyboard = require( "storyboard" )
|
8
|
+
local scene = storyboard.newScene()
|
9
|
+
|
10
|
+
-----------------------------------------------------------------------------------------
|
11
|
+
-- BEGINNING OF YOUR IMPLEMENTATION
|
12
|
+
--
|
13
|
+
-- NOTE: Code outside of listener functions (below) will only be executed once,
|
14
|
+
-- unless storyboard.removeScene() is called.
|
15
|
+
--
|
16
|
+
-----------------------------------------------------------------------------------------
|
17
|
+
|
18
|
+
-- Called when the scene's view does not exist:
|
19
|
+
function scene:createScene( event )
|
20
|
+
local group = self.view
|
21
|
+
|
22
|
+
-- create a white background to fill screen
|
23
|
+
local bg = display.newRect( 0, 0, display.contentWidth, display.contentHeight )
|
24
|
+
bg:setFillColor( 255 ) -- white
|
25
|
+
|
26
|
+
-- create some text
|
27
|
+
local title = display.newText( "Second View", 0, 0, native.systemFont, 32 )
|
28
|
+
title:setTextColor( 0 ) -- black
|
29
|
+
title:setReferencePoint( display.CenterReferencePoint )
|
30
|
+
title.x = display.contentWidth * 0.5
|
31
|
+
title.y = 125
|
32
|
+
|
33
|
+
local summary = display.newText( "Loaded by the first tab 'onPress' listener\n— specified in the 'tabButtons' table.", 0, 0, 300, 300, native.systemFont, 14 )
|
34
|
+
summary:setTextColor( 0 ) -- black
|
35
|
+
summary:setReferencePoint( display.CenterReferencePoint )
|
36
|
+
summary.x = display.contentWidth * 0.5 + 10
|
37
|
+
summary.y = title.y + 215
|
38
|
+
|
39
|
+
-- all objects must be added to group (e.g. self.view)
|
40
|
+
group:insert( bg )
|
41
|
+
group:insert( title )
|
42
|
+
group:insert( summary )
|
43
|
+
end
|
44
|
+
|
45
|
+
-- Called immediately after scene has moved onscreen:
|
46
|
+
function scene:enterScene( event )
|
47
|
+
local group = self.view
|
48
|
+
|
49
|
+
-- do nothing
|
50
|
+
|
51
|
+
end
|
52
|
+
|
53
|
+
-- Called when scene is about to move offscreen:
|
54
|
+
function scene:exitScene( event )
|
55
|
+
local group = self.view
|
56
|
+
|
57
|
+
-- INSERT code here (e.g. stop timers, remove listenets, unload sounds, etc.)
|
58
|
+
|
59
|
+
end
|
60
|
+
|
61
|
+
-- If scene's view is removed, scene:destroyScene() will be called just prior to:
|
62
|
+
function scene:destroyScene( event )
|
63
|
+
local group = self.view
|
64
|
+
|
65
|
+
-- INSERT code here (e.g. remove listeners, remove widgets, save state variables, etc.)
|
66
|
+
|
67
|
+
end
|
68
|
+
|
69
|
+
-----------------------------------------------------------------------------------------
|
70
|
+
-- END OF YOUR IMPLEMENTATION
|
71
|
+
-----------------------------------------------------------------------------------------
|
72
|
+
|
73
|
+
-- "createScene" event is dispatched if scene's view does not exist
|
74
|
+
scene:addEventListener( "createScene", scene )
|
75
|
+
|
76
|
+
-- "enterScene" event is dispatched whenever scene transition has finished
|
77
|
+
scene:addEventListener( "enterScene", scene )
|
78
|
+
|
79
|
+
-- "exitScene" event is dispatched whenever before next scene's transition begins
|
80
|
+
scene:addEventListener( "exitScene", scene )
|
81
|
+
|
82
|
+
-- "destroyScene" event is dispatched before view is unloaded, which can be
|
83
|
+
-- automatically unloaded in low memory situations, or explicitly via a call to
|
84
|
+
-- storyboard.purgeScene() or storyboard.removeScene().
|
85
|
+
scene:addEventListener( "destroyScene", scene )
|
86
|
+
|
87
|
+
-----------------------------------------------------------------------------------------
|
88
|
+
|
89
|
+
return scene
|
@@ -0,0 +1,41 @@
|
|
1
|
+
-- Supported values for orientation:
|
2
|
+
-- portrait, portraitUpsideDown, landscapeLeft, landscapeRight
|
3
|
+
|
4
|
+
settings = {
|
5
|
+
|
6
|
+
orientation = {
|
7
|
+
default = { <%= @orient %> },
|
8
|
+
supported = { <%= @orient %> }
|
9
|
+
},
|
10
|
+
|
11
|
+
iphone = {
|
12
|
+
plist = {
|
13
|
+
UIStatusBarHidden = false,
|
14
|
+
UIPrerenderedIcon = true, -- set to false for "shine" overlay
|
15
|
+
--UIApplicationExitsOnSuspend = true, -- uncomment to quit app on suspend
|
16
|
+
|
17
|
+
--[[
|
18
|
+
-- iOS app URL schemes:
|
19
|
+
CFBundleURLTypes =
|
20
|
+
{
|
21
|
+
{
|
22
|
+
CFBundleURLSchemes =
|
23
|
+
{
|
24
|
+
"fbXXXXXXXXXXXXXX", -- example scheme for facebook
|
25
|
+
"coronasdkapp", -- example second scheme
|
26
|
+
}
|
27
|
+
}
|
28
|
+
}
|
29
|
+
--]]
|
30
|
+
}
|
31
|
+
},
|
32
|
+
|
33
|
+
--[[
|
34
|
+
-- Android permissions
|
35
|
+
|
36
|
+
androidPermissions = {
|
37
|
+
"android.permission.INTERNET",
|
38
|
+
},
|
39
|
+
|
40
|
+
]]--
|
41
|
+
}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
application = {
|
2
|
+
content = {
|
3
|
+
width = <%= @width %>,
|
4
|
+
height = <%= @height %>,
|
5
|
+
scale = "letterBox",
|
6
|
+
fps = 30,
|
7
|
+
|
8
|
+
--[[
|
9
|
+
imageSuffix = {
|
10
|
+
["@2x"] = 2,
|
11
|
+
}
|
12
|
+
--]]
|
13
|
+
},
|
14
|
+
|
15
|
+
--[[
|
16
|
+
-- Push notifications
|
17
|
+
|
18
|
+
notification =
|
19
|
+
{
|
20
|
+
iphone =
|
21
|
+
{
|
22
|
+
types =
|
23
|
+
{
|
24
|
+
"badge", "sound", "alert", "newsstand"
|
25
|
+
}
|
26
|
+
}
|
27
|
+
}
|
28
|
+
--]]
|
29
|
+
}
|
Binary file
|
Binary file
|
@@ -0,0 +1,14 @@
|
|
1
|
+
-----------------------------------------------------------------------------------------
|
2
|
+
--
|
3
|
+
-- main.lua
|
4
|
+
--
|
5
|
+
-----------------------------------------------------------------------------------------
|
6
|
+
|
7
|
+
-- hide the status bar
|
8
|
+
display.setStatusBar( display.HiddenStatusBar )
|
9
|
+
|
10
|
+
-- include the Corona "storyboard" module
|
11
|
+
local storyboard = require "storyboard"
|
12
|
+
|
13
|
+
-- load title screen
|
14
|
+
storyboard.gotoScene( "title", "fade" )
|
Binary file
|