diff --git a/Physics/Conveyers/AndroidResources/res/mipmap-anydpi-v26/ic_launcher.xml b/Physics/Conveyers/AndroidResources/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..036d09b --- /dev/null +++ b/Physics/Conveyers/AndroidResources/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Physics/Conveyers/AndroidResources/res/mipmap-hdpi/ic_launcher.png b/Physics/Conveyers/AndroidResources/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000..f26ec56 Binary files /dev/null and b/Physics/Conveyers/AndroidResources/res/mipmap-hdpi/ic_launcher.png differ diff --git a/Physics/Conveyers/AndroidResources/res/mipmap-hdpi/ic_launcher_foreground.png b/Physics/Conveyers/AndroidResources/res/mipmap-hdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..aad97fd Binary files /dev/null and b/Physics/Conveyers/AndroidResources/res/mipmap-hdpi/ic_launcher_foreground.png differ diff --git a/Physics/Conveyers/AndroidResources/res/mipmap-mdpi/ic_launcher.png b/Physics/Conveyers/AndroidResources/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000..9983f04 Binary files /dev/null and b/Physics/Conveyers/AndroidResources/res/mipmap-mdpi/ic_launcher.png differ diff --git a/Physics/Conveyers/AndroidResources/res/mipmap-mdpi/ic_launcher_foreground.png b/Physics/Conveyers/AndroidResources/res/mipmap-mdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..af92622 Binary files /dev/null and b/Physics/Conveyers/AndroidResources/res/mipmap-mdpi/ic_launcher_foreground.png differ diff --git a/Physics/Conveyers/AndroidResources/res/mipmap-xhdpi/ic_launcher.png b/Physics/Conveyers/AndroidResources/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000..cabbf62 Binary files /dev/null and b/Physics/Conveyers/AndroidResources/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/Physics/Conveyers/AndroidResources/res/mipmap-xhdpi/ic_launcher_foreground.png b/Physics/Conveyers/AndroidResources/res/mipmap-xhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..9d9d243 Binary files /dev/null and b/Physics/Conveyers/AndroidResources/res/mipmap-xhdpi/ic_launcher_foreground.png differ diff --git a/Physics/Conveyers/AndroidResources/res/mipmap-xxhdpi/ic_launcher.png b/Physics/Conveyers/AndroidResources/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000..8146ebb Binary files /dev/null and b/Physics/Conveyers/AndroidResources/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/Physics/Conveyers/AndroidResources/res/mipmap-xxhdpi/ic_launcher_foreground.png b/Physics/Conveyers/AndroidResources/res/mipmap-xxhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..68a7e77 Binary files /dev/null and b/Physics/Conveyers/AndroidResources/res/mipmap-xxhdpi/ic_launcher_foreground.png differ diff --git a/Physics/Conveyers/AndroidResources/res/mipmap-xxxhdpi/ic_launcher.png b/Physics/Conveyers/AndroidResources/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000..f7179e9 Binary files /dev/null and b/Physics/Conveyers/AndroidResources/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/Physics/Conveyers/AndroidResources/res/mipmap-xxxhdpi/ic_launcher_foreground.png b/Physics/Conveyers/AndroidResources/res/mipmap-xxxhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..957ce9d Binary files /dev/null and b/Physics/Conveyers/AndroidResources/res/mipmap-xxxhdpi/ic_launcher_foreground.png differ diff --git a/Physics/Conveyers/AndroidResources/res/values/values.xml b/Physics/Conveyers/AndroidResources/res/values/values.xml new file mode 100644 index 0000000..9a8e739 --- /dev/null +++ b/Physics/Conveyers/AndroidResources/res/values/values.xml @@ -0,0 +1,4 @@ + + + #15073e + diff --git a/Physics/Conveyers/Icon.png b/Physics/Conveyers/Icon.png new file mode 100644 index 0000000..9993146 Binary files /dev/null and b/Physics/Conveyers/Icon.png differ diff --git a/Physics/Conveyers/Images.xcassets/AppIcon.appiconset/Contents.json b/Physics/Conveyers/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..477b25b --- /dev/null +++ b/Physics/Conveyers/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,108 @@ +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-40.png", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-58.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-87.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-80.png", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-120.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-180.png", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-76.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-152.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "Icon-167.png", + "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "Icon-1024.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Physics/Conveyers/Images.xcassets/AppIcon.appiconset/Icon-1024.png b/Physics/Conveyers/Images.xcassets/AppIcon.appiconset/Icon-1024.png new file mode 100644 index 0000000..4877fde Binary files /dev/null and b/Physics/Conveyers/Images.xcassets/AppIcon.appiconset/Icon-1024.png differ diff --git a/Physics/Conveyers/Images.xcassets/AppIcon.appiconset/Icon-120.png b/Physics/Conveyers/Images.xcassets/AppIcon.appiconset/Icon-120.png new file mode 100644 index 0000000..56954a7 Binary files /dev/null and b/Physics/Conveyers/Images.xcassets/AppIcon.appiconset/Icon-120.png differ diff --git a/Physics/Conveyers/Images.xcassets/AppIcon.appiconset/Icon-152.png b/Physics/Conveyers/Images.xcassets/AppIcon.appiconset/Icon-152.png new file mode 100644 index 0000000..c171f78 Binary files /dev/null and b/Physics/Conveyers/Images.xcassets/AppIcon.appiconset/Icon-152.png differ diff --git a/Physics/Conveyers/Images.xcassets/AppIcon.appiconset/Icon-167.png b/Physics/Conveyers/Images.xcassets/AppIcon.appiconset/Icon-167.png new file mode 100644 index 0000000..8a37893 Binary files /dev/null and b/Physics/Conveyers/Images.xcassets/AppIcon.appiconset/Icon-167.png differ diff --git a/Physics/Conveyers/Images.xcassets/AppIcon.appiconset/Icon-180.png b/Physics/Conveyers/Images.xcassets/AppIcon.appiconset/Icon-180.png new file mode 100644 index 0000000..1cf391e Binary files /dev/null and b/Physics/Conveyers/Images.xcassets/AppIcon.appiconset/Icon-180.png differ diff --git a/Physics/Conveyers/Images.xcassets/AppIcon.appiconset/Icon-40.png b/Physics/Conveyers/Images.xcassets/AppIcon.appiconset/Icon-40.png new file mode 100644 index 0000000..7c18b30 Binary files /dev/null and b/Physics/Conveyers/Images.xcassets/AppIcon.appiconset/Icon-40.png differ diff --git a/Physics/Conveyers/Images.xcassets/AppIcon.appiconset/Icon-58.png b/Physics/Conveyers/Images.xcassets/AppIcon.appiconset/Icon-58.png new file mode 100644 index 0000000..62a5e1d Binary files /dev/null and b/Physics/Conveyers/Images.xcassets/AppIcon.appiconset/Icon-58.png differ diff --git a/Physics/Conveyers/Images.xcassets/AppIcon.appiconset/Icon-76.png b/Physics/Conveyers/Images.xcassets/AppIcon.appiconset/Icon-76.png new file mode 100644 index 0000000..4dd0318 Binary files /dev/null and b/Physics/Conveyers/Images.xcassets/AppIcon.appiconset/Icon-76.png differ diff --git a/Physics/Conveyers/Images.xcassets/AppIcon.appiconset/Icon-80.png b/Physics/Conveyers/Images.xcassets/AppIcon.appiconset/Icon-80.png new file mode 100644 index 0000000..5471ea1 Binary files /dev/null and b/Physics/Conveyers/Images.xcassets/AppIcon.appiconset/Icon-80.png differ diff --git a/Physics/Conveyers/Images.xcassets/AppIcon.appiconset/Icon-87.png b/Physics/Conveyers/Images.xcassets/AppIcon.appiconset/Icon-87.png new file mode 100644 index 0000000..1604117 Binary files /dev/null and b/Physics/Conveyers/Images.xcassets/AppIcon.appiconset/Icon-87.png differ diff --git a/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Content.imageset/Contents.json b/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Content.imageset/Contents.json new file mode 100644 index 0000000..0a77c69 --- /dev/null +++ b/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Content.imageset/Contents.json @@ -0,0 +1,17 @@ +{ + "images" : [ + { + "idiom" : "tv", + "filename" : "Icon-tvOS-Large-Background.png", + "scale" : "1x" + }, + { + "idiom" : "tv", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Content.imageset/Icon-tvOS-Large-Background.png b/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Content.imageset/Icon-tvOS-Large-Background.png new file mode 100644 index 0000000..c4a5bc4 Binary files /dev/null and b/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Content.imageset/Icon-tvOS-Large-Background.png differ diff --git a/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Contents.json b/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Contents.json new file mode 100644 index 0000000..da4a164 --- /dev/null +++ b/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Large.imagestack/Contents.json b/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Large.imagestack/Contents.json new file mode 100644 index 0000000..d29f024 --- /dev/null +++ b/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Large.imagestack/Contents.json @@ -0,0 +1,17 @@ +{ + "layers" : [ + { + "filename" : "Front.imagestacklayer" + }, + { + "filename" : "Middle.imagestacklayer" + }, + { + "filename" : "Back.imagestacklayer" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Content.imageset/Contents.json b/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Content.imageset/Contents.json new file mode 100644 index 0000000..b18949a --- /dev/null +++ b/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Content.imageset/Contents.json @@ -0,0 +1,17 @@ +{ + "images" : [ + { + "idiom" : "tv", + "filename" : "Icon-tvOS-Large-LogoA.png", + "scale" : "1x" + }, + { + "idiom" : "tv", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Content.imageset/Icon-tvOS-Large-LogoA.png b/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Content.imageset/Icon-tvOS-Large-LogoA.png new file mode 100644 index 0000000..aa9d838 Binary files /dev/null and b/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Content.imageset/Icon-tvOS-Large-LogoA.png differ diff --git a/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Contents.json b/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Contents.json new file mode 100644 index 0000000..da4a164 --- /dev/null +++ b/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Large.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json b/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Large.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json new file mode 100644 index 0000000..b1c15fb --- /dev/null +++ b/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Large.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json @@ -0,0 +1,17 @@ +{ + "images" : [ + { + "idiom" : "tv", + "filename" : "Icon-tvOS-Large-LogoB.png", + "scale" : "1x" + }, + { + "idiom" : "tv", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Large.imagestack/Middle.imagestacklayer/Content.imageset/Icon-tvOS-Large-LogoB.png b/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Large.imagestack/Middle.imagestacklayer/Content.imageset/Icon-tvOS-Large-LogoB.png new file mode 100644 index 0000000..4392e29 Binary files /dev/null and b/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Large.imagestack/Middle.imagestacklayer/Content.imageset/Icon-tvOS-Large-LogoB.png differ diff --git a/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Large.imagestack/Middle.imagestacklayer/Contents.json b/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Large.imagestack/Middle.imagestacklayer/Contents.json new file mode 100644 index 0000000..da4a164 --- /dev/null +++ b/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Large.imagestack/Middle.imagestacklayer/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Content.imageset/Contents.json b/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Content.imageset/Contents.json new file mode 100644 index 0000000..f8d4df9 --- /dev/null +++ b/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Content.imageset/Contents.json @@ -0,0 +1,18 @@ +{ + "images" : [ + { + "idiom" : "tv", + "filename" : "Icon-tvOS-Small-Bg.png", + "scale" : "1x" + }, + { + "idiom" : "tv", + "filename" : "Icon-tvOS-Small-Bg@2x.png", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Content.imageset/Icon-tvOS-Small-Bg.png b/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Content.imageset/Icon-tvOS-Small-Bg.png new file mode 100644 index 0000000..ad2109a Binary files /dev/null and b/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Content.imageset/Icon-tvOS-Small-Bg.png differ diff --git a/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Content.imageset/Icon-tvOS-Small-Bg@2x.png b/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Content.imageset/Icon-tvOS-Small-Bg@2x.png new file mode 100644 index 0000000..6d47b9e Binary files /dev/null and b/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Content.imageset/Icon-tvOS-Small-Bg@2x.png differ diff --git a/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Contents.json b/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Contents.json new file mode 100644 index 0000000..da4a164 --- /dev/null +++ b/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Small.imagestack/Contents.json b/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Small.imagestack/Contents.json new file mode 100644 index 0000000..d29f024 --- /dev/null +++ b/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Small.imagestack/Contents.json @@ -0,0 +1,17 @@ +{ + "layers" : [ + { + "filename" : "Front.imagestacklayer" + }, + { + "filename" : "Middle.imagestacklayer" + }, + { + "filename" : "Back.imagestacklayer" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Content.imageset/Contents.json b/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Content.imageset/Contents.json new file mode 100644 index 0000000..6978d9b --- /dev/null +++ b/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Content.imageset/Contents.json @@ -0,0 +1,18 @@ +{ + "images" : [ + { + "idiom" : "tv", + "filename" : "Icon-tvOS-Small-LogoA.png", + "scale" : "1x" + }, + { + "idiom" : "tv", + "filename" : "Icon-tvOS-Small-LogoA@2x.png", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Content.imageset/Icon-tvOS-Small-LogoA.png b/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Content.imageset/Icon-tvOS-Small-LogoA.png new file mode 100644 index 0000000..e4626ff Binary files /dev/null and b/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Content.imageset/Icon-tvOS-Small-LogoA.png differ diff --git a/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Content.imageset/Icon-tvOS-Small-LogoA@2x.png b/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Content.imageset/Icon-tvOS-Small-LogoA@2x.png new file mode 100644 index 0000000..11d5c8c Binary files /dev/null and b/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Content.imageset/Icon-tvOS-Small-LogoA@2x.png differ diff --git a/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Contents.json b/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Contents.json new file mode 100644 index 0000000..da4a164 --- /dev/null +++ b/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Small.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json b/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Small.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json new file mode 100644 index 0000000..f943623 --- /dev/null +++ b/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Small.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json @@ -0,0 +1,18 @@ +{ + "images" : [ + { + "idiom" : "tv", + "filename" : "Icon-tvOS-Small-LogoB.png", + "scale" : "1x" + }, + { + "idiom" : "tv", + "filename" : "Icon-tvOS-Small-LogoB@2x.png", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Small.imagestack/Middle.imagestacklayer/Content.imageset/Icon-tvOS-Small-LogoB.png b/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Small.imagestack/Middle.imagestacklayer/Content.imageset/Icon-tvOS-Small-LogoB.png new file mode 100644 index 0000000..feaeddf Binary files /dev/null and b/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Small.imagestack/Middle.imagestacklayer/Content.imageset/Icon-tvOS-Small-LogoB.png differ diff --git a/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Small.imagestack/Middle.imagestacklayer/Content.imageset/Icon-tvOS-Small-LogoB@2x.png b/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Small.imagestack/Middle.imagestacklayer/Content.imageset/Icon-tvOS-Small-LogoB@2x.png new file mode 100644 index 0000000..c036709 Binary files /dev/null and b/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Small.imagestack/Middle.imagestacklayer/Content.imageset/Icon-tvOS-Small-LogoB@2x.png differ diff --git a/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Small.imagestack/Middle.imagestacklayer/Contents.json b/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Small.imagestack/Middle.imagestacklayer/Contents.json new file mode 100644 index 0000000..da4a164 --- /dev/null +++ b/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/App Icon - Small.imagestack/Middle.imagestacklayer/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/Contents.json b/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/Contents.json new file mode 100644 index 0000000..dea6e49 --- /dev/null +++ b/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/Contents.json @@ -0,0 +1,32 @@ +{ + "assets" : [ + { + "size" : "1280x768", + "idiom" : "tv", + "filename" : "App Icon - Large.imagestack", + "role" : "primary-app-icon" + }, + { + "size" : "400x240", + "idiom" : "tv", + "filename" : "App Icon - Small.imagestack", + "role" : "primary-app-icon" + }, + { + "size" : "2320x720", + "idiom" : "tv", + "filename" : "Top Shelf Image Wide.imageset", + "role" : "top-shelf-image-wide" + }, + { + "size" : "1920x720", + "idiom" : "tv", + "filename" : "Top Shelf Image.imageset", + "role" : "top-shelf-image" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/Top Shelf Image Wide.imageset/Contents.json b/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/Top Shelf Image Wide.imageset/Contents.json new file mode 100644 index 0000000..eaca6c6 --- /dev/null +++ b/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/Top Shelf Image Wide.imageset/Contents.json @@ -0,0 +1,18 @@ +{ + "images" : [ + { + "idiom" : "tv", + "filename" : "Icon-tvOS-TopShelfWide.png", + "scale" : "1x" + }, + { + "idiom" : "tv", + "filename" : "Icon-tvOS-TopShelfWide@2x.png", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/Top Shelf Image Wide.imageset/Icon-tvOS-TopShelfWide.png b/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/Top Shelf Image Wide.imageset/Icon-tvOS-TopShelfWide.png new file mode 100644 index 0000000..49a6438 Binary files /dev/null and b/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/Top Shelf Image Wide.imageset/Icon-tvOS-TopShelfWide.png differ diff --git a/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/Top Shelf Image Wide.imageset/Icon-tvOS-TopShelfWide@2x.png b/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/Top Shelf Image Wide.imageset/Icon-tvOS-TopShelfWide@2x.png new file mode 100644 index 0000000..c24dae2 Binary files /dev/null and b/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/Top Shelf Image Wide.imageset/Icon-tvOS-TopShelfWide@2x.png differ diff --git a/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/Top Shelf Image.imageset/Contents.json b/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/Top Shelf Image.imageset/Contents.json new file mode 100644 index 0000000..4d31458 --- /dev/null +++ b/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/Top Shelf Image.imageset/Contents.json @@ -0,0 +1,18 @@ +{ + "images" : [ + { + "idiom" : "tv", + "filename" : "Icon-tvOS-TopShelf.png", + "scale" : "1x" + }, + { + "idiom" : "tv", + "filename" : "Icon-tvOS-TopShelf@2x.png", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/Top Shelf Image.imageset/Icon-tvOS-TopShelf.png b/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/Top Shelf Image.imageset/Icon-tvOS-TopShelf.png new file mode 100644 index 0000000..d727167 Binary files /dev/null and b/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/Top Shelf Image.imageset/Icon-tvOS-TopShelf.png differ diff --git a/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/Top Shelf Image.imageset/Icon-tvOS-TopShelf@2x.png b/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/Top Shelf Image.imageset/Icon-tvOS-TopShelf@2x.png new file mode 100644 index 0000000..1218f30 Binary files /dev/null and b/Physics/Conveyers/Images.xcassets/AppIconTV.brandassets/Top Shelf Image.imageset/Icon-tvOS-TopShelf@2x.png differ diff --git a/Physics/Conveyers/Images.xcassets/Contents.json b/Physics/Conveyers/Images.xcassets/Contents.json new file mode 100644 index 0000000..da4a164 --- /dev/null +++ b/Physics/Conveyers/Images.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Physics/Conveyers/Images.xcassets/LaunchImageTV.launchimage/Contents.json b/Physics/Conveyers/Images.xcassets/LaunchImageTV.launchimage/Contents.json new file mode 100644 index 0000000..e124a4c --- /dev/null +++ b/Physics/Conveyers/Images.xcassets/LaunchImageTV.launchimage/Contents.json @@ -0,0 +1,24 @@ +{ + "images" : [ + { + "orientation" : "landscape", + "idiom" : "tv", + "filename" : "Icon-tvOS-Launch@2x.png", + "extent" : "full-screen", + "minimum-system-version" : "11.0", + "scale" : "2x" + }, + { + "orientation" : "landscape", + "idiom" : "tv", + "filename" : "Icon-tvOS-Launch.png", + "extent" : "full-screen", + "minimum-system-version" : "9.0", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Physics/Conveyers/Images.xcassets/LaunchImageTV.launchimage/Icon-tvOS-Launch.png b/Physics/Conveyers/Images.xcassets/LaunchImageTV.launchimage/Icon-tvOS-Launch.png new file mode 100644 index 0000000..8dc21f6 Binary files /dev/null and b/Physics/Conveyers/Images.xcassets/LaunchImageTV.launchimage/Icon-tvOS-Launch.png differ diff --git a/Physics/Conveyers/Images.xcassets/LaunchImageTV.launchimage/Icon-tvOS-Launch@2x.png b/Physics/Conveyers/Images.xcassets/LaunchImageTV.launchimage/Icon-tvOS-Launch@2x.png new file mode 100644 index 0000000..7d9aafd Binary files /dev/null and b/Physics/Conveyers/Images.xcassets/LaunchImageTV.launchimage/Icon-tvOS-Launch@2x.png differ diff --git a/Physics/Conveyers/LaunchScreen.storyboardc/01J-lp-oVM-view-Ze5-6b-2t3.nib b/Physics/Conveyers/LaunchScreen.storyboardc/01J-lp-oVM-view-Ze5-6b-2t3.nib new file mode 100644 index 0000000..351e482 Binary files /dev/null and b/Physics/Conveyers/LaunchScreen.storyboardc/01J-lp-oVM-view-Ze5-6b-2t3.nib differ diff --git a/Physics/Conveyers/LaunchScreen.storyboardc/Info.plist b/Physics/Conveyers/LaunchScreen.storyboardc/Info.plist new file mode 100644 index 0000000..32288e8 Binary files /dev/null and b/Physics/Conveyers/LaunchScreen.storyboardc/Info.plist differ diff --git a/Physics/Conveyers/LaunchScreen.storyboardc/UIViewController-01J-lp-oVM.nib b/Physics/Conveyers/LaunchScreen.storyboardc/UIViewController-01J-lp-oVM.nib new file mode 100644 index 0000000..48a7d93 Binary files /dev/null and b/Physics/Conveyers/LaunchScreen.storyboardc/UIViewController-01J-lp-oVM.nib differ diff --git a/Physics/Conveyers/LaunchScreen.storyboardc/designable.storyboard b/Physics/Conveyers/LaunchScreen.storyboardc/designable.storyboard new file mode 100644 index 0000000..cca8ab4 --- /dev/null +++ b/Physics/Conveyers/LaunchScreen.storyboardc/designable.storyboard @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Physics/Conveyers/ReadMe.txt b/Physics/Conveyers/ReadMe.txt new file mode 100644 index 0000000..098ab10 --- /dev/null +++ b/Physics/Conveyers/ReadMe.txt @@ -0,0 +1,8 @@ +This sample project demonstrates polygonal body constructors and tilt-based gravity effects for Android, iOS, and tvOS. + +Turn the device around (orientation) to see how the objects tumble around as if contained in a tumbler. A couple of the +surfaces also behave like conveyer belts. + +RELATED GUIDES +[Basic Interactivity and Event Detection](https://docs.coronalabs.com/guide/events/detectEvents/index.html) +[Physics Bodies](https://docs.coronalabs.com/guide/physics/physicsBodies/index.html) diff --git a/Physics/Conveyers/build.settings b/Physics/Conveyers/build.settings new file mode 100644 index 0000000..c3ba060 --- /dev/null +++ b/Physics/Conveyers/build.settings @@ -0,0 +1,42 @@ +-- +-- For more information on build.settings, see the Project Build Settings guide at: +-- https://docs.coronalabs.com/guide/distribution/buildSettings +-- + +settings = +{ + orientation = + { + -- Supported values for orientation: + -- portrait, portraitUpsideDown, landscapeLeft, landscapeRight + default = "landscapeRight", + supported = { "landscapeRight" } + }, + + iphone = + { + xcassets = "Images.xcassets", + plist = + { + UILaunchStoryboardName = "LaunchScreen", + ITSAppUsesNonExemptEncryption = false, -- This sample doesn't use custom encryption + }, + }, + + tvos = + { + xcassets = "Images.xcassets", + plist = + { + ITSAppUsesNonExemptEncryption = false, -- This sample doesn't use custom encryption + }, + }, + + window = + { + titleText = + { + default = "Shape Tumbler with conveyers", + }, + }, +} diff --git a/Physics/Conveyers/config.lua b/Physics/Conveyers/config.lua new file mode 100644 index 0000000..e84b3c2 --- /dev/null +++ b/Physics/Conveyers/config.lua @@ -0,0 +1,19 @@ + +application = +{ + content = + { + fps = 60, + width = 320, + height = 480, + scale = "letterbox", + xAlign = "center", + yAlign = "center", + + imageSuffix = + { + ["@2x"] = 2.000, + ["@4x"] = 4.000 + } + } +} diff --git a/Physics/Conveyers/main.lua b/Physics/Conveyers/main.lua new file mode 100644 index 0000000..a6e1a06 --- /dev/null +++ b/Physics/Conveyers/main.lua @@ -0,0 +1,179 @@ + +-- Abstract: Shape Tumbler, with conveyer belt mechanics +-- Version: 1.1 +-- Sample code is MIT licensed; see https://solar2d.com/LICENSE.txt +--------------------------------------------------------------------------------------- + +display.setStatusBar( display.HiddenStatusBar ) +math.randomseed( os.time() ) + +------------------------------ +-- RENDER THE SAMPLE CODE UI +------------------------------ +local sampleUI = require( "sampleUI.sampleUI" ) +sampleUI:newUI( { theme="darkgrey", title="Shape Tumbler with Conveyer Belt", showBuildNum=false } ) + +------------------------------ +-- CONFIGURE STAGE +------------------------------ +display.getCurrentStage():insert( sampleUI.backGroup ) +local worldGroup = display.newGroup() +display.getCurrentStage():insert( sampleUI.frontGroup ) + +---------------------- +-- BEGIN SAMPLE CODE +---------------------- + +-- Set up physics engine +local physics = require( "physics" ) +physics.start( true ) -- Pass "true" as first parameter to prevent bodies from sleeping +physics.setGravity( 0, 9.8 ) -- Initial gravity points downwards +physics.setScale( 60 ) + +-- Declare initial variables +local letterboxWidth = math.abs(display.screenOriginX) +local letterboxHeight = math.abs(display.screenOriginY) + +-- Create "walls" around screen +local wallL = display.newRect( worldGroup, 0-letterboxWidth, display.contentCenterY, 20, display.actualContentHeight ) +wallL.anchorX = 1 +physics.addBody( wallL, "static", { bounce=1, friction=0.1 } ) + +wallL.tangentSpeed = 20 + +local wallR = display.newRect( worldGroup, 480+letterboxWidth, display.contentCenterY, 20, display.actualContentHeight ) +wallR.anchorX = 0 +physics.addBody( wallR, "static", { bounce=1, friction=0.1 } ) + +local wallT = display.newRect( worldGroup, display.contentCenterX, 0-letterboxHeight, display.actualContentWidth, 20 ) +wallT.anchorY = 1 +physics.addBody( wallT, "static", { bounce=0, friction=0 } ) + +local wallB = display.newRect( worldGroup, display.contentCenterX, 320+letterboxHeight, display.actualContentWidth, 20 ) +wallB.anchorY = 0 +physics.addBody( wallB, "static", { bounce=0.4, friction=0.6 } ) + +wallB.tangentSpeed = 2 + +-- Create triangle function +local function createTriangle() + local triangleShape = { 0,-32, 37,32, -37,32 } + local triangle = display.newPolygon( worldGroup, 0, 0, triangleShape ) + physics.addBody( triangle, { friction=0.5, bounce=0.3, shape=triangleShape } ) + return triangle +end + +-- Create hexagon function +local function createHexagon() + local hexagonShape = { 0,-38, 33,-19, 33,19, 0,38, -33,19, -33,-19 } + local hexagon = display.newPolygon( worldGroup, 0, 0, hexagonShape ) + physics.addBody( hexagon, { friction=0.5, bounce=0.4, shape=hexagonShape } ) + return hexagon +end + +-- Create small box function +local function createBoxSmall() + local boxSmall = display.newRect( worldGroup, 0, 0, 50, 50 ) + physics.addBody( boxSmall, { friction=0.5, bounce=0.4 } ) + return boxSmall +end + +-- Create large box function +local function createBoxLarge() + local boxLarge = display.newRect( worldGroup, 0, 0, 75, 75 ) + physics.addBody( boxLarge, { friction=0.5, bounce=0.4 } ) + return boxLarge +end + +-- Create cell function +local function createCell() + local cellShape = { -30,-10, -25,-15, 25,-15, 30,-10, 30,10, 25,15, -25,15, -30,10 } + local cell = display.newPolygon( worldGroup, 0, 0, cellShape ) + physics.addBody( cell, { friction=0.5, bounce=0.4, shape=cellShape } ) + return cell +end + +-- Create ball function +local function createBall() + local ball = display.newCircle( worldGroup, 0, 0, 30 ) + physics.addBody( ball, { friction=0.5, bounce=0.7, radius=30 } ) + return ball +end + +-- Create random object function +local function createRandomObject() + local r = math.random( 1, 6 ) + local object + + if ( r == 1 ) then + object = createTriangle() + elseif ( r == 2 ) then + object = createHexagon() + elseif ( r == 3 ) then + object = createBoxSmall() + elseif ( r == 4 ) then + object = createBoxLarge() + elseif ( r == 5 ) then + object = createCell() + elseif ( r == 6 ) then + object = createBall() + end + + return object +end + +local function setConveyerMotion( event ) + if event.phase == "began" then + if event.other.tangentSpeed then + event.contact.tangentSpeed = event.other.tangentSpeed + end + end +end + +-- Fill the content area with some objects +local function spawnObjects() + local xIndex = 0 + local yPos = 100 + + for i = 1, 8 do + local object = createRandomObject() + object:setFillColor( ( math.random( 4, 8 ) / 10 ), ( math.random( 0, 2 ) / 10 ), ( math.random( 4, 10 ) / 10 ) ) + + object:addEventListener( "collision", setConveyerMotion ) + + if ( xIndex == 4 ) then + xIndex = 0 + yPos = 220 + end + + object.y = yPos + ( math.random( -1, 1 ) * 15 ) + object.x = ( xIndex * 120 ) + 60 + ( math.random( -1, 1 ) * 15 ) + xIndex = xIndex + 1 + end +end + +-- Function to adjust gravity based on accelerometer response +local function onTilt( event ) + -- Gravity is in portrait orientation on Android, iOS, and Windows Phone + -- On tvOS, gravity is in the orientation of the device attached to the event + if ( event.device ) then + physics.setGravity( ( 9.8 * event.xGravity ), ( -9.8 * event.yGravity ) ) + else + physics.setGravity( ( -9.8 * event.yGravity ), ( -9.8 * event.xGravity ) ) + end +end + +-- Detect if accelerometer is supported +if ( system.hasEventSource( "accelerometer" ) ) then + -- Set accelerometer to maximum responsiveness + system.setAccelerometerInterval( 100 ) + -- Start listening for accelerometer events + Runtime:addEventListener( "accelerometer", onTilt ) + -- Spawn some objects + spawnObjects() +else + local shade = display.newRect( worldGroup, display.contentCenterX, display.contentHeight-display.screenOriginY-18, display.actualContentWidth, 36 ) + shade:setFillColor( 0, 0, 0, 0.7 ) + local msg = display.newText( worldGroup, "Accelerometer not supported on this platform", display.contentCenterX, shade.y, appFont, 13 ) + msg:setFillColor( 1, 0, 0.2 ) +end diff --git a/Physics/Conveyers/sampleUI/back-darkgrey.png b/Physics/Conveyers/sampleUI/back-darkgrey.png new file mode 100644 index 0000000..6b2c1a3 Binary files /dev/null and b/Physics/Conveyers/sampleUI/back-darkgrey.png differ diff --git a/Physics/Conveyers/sampleUI/back-darkgrey@2x.png b/Physics/Conveyers/sampleUI/back-darkgrey@2x.png new file mode 100644 index 0000000..93fdf80 Binary files /dev/null and b/Physics/Conveyers/sampleUI/back-darkgrey@2x.png differ diff --git a/Physics/Conveyers/sampleUI/back-darkgrey@4x.png b/Physics/Conveyers/sampleUI/back-darkgrey@4x.png new file mode 100644 index 0000000..303b535 Binary files /dev/null and b/Physics/Conveyers/sampleUI/back-darkgrey@4x.png differ diff --git a/Physics/Conveyers/sampleUI/infobutton.png b/Physics/Conveyers/sampleUI/infobutton.png new file mode 100644 index 0000000..c602921 Binary files /dev/null and b/Physics/Conveyers/sampleUI/infobutton.png differ diff --git a/Physics/Conveyers/sampleUI/infobutton@2x.png b/Physics/Conveyers/sampleUI/infobutton@2x.png new file mode 100644 index 0000000..d1c6cef Binary files /dev/null and b/Physics/Conveyers/sampleUI/infobutton@2x.png differ diff --git a/Physics/Conveyers/sampleUI/infobutton@4x.png b/Physics/Conveyers/sampleUI/infobutton@4x.png new file mode 100644 index 0000000..1520fcc Binary files /dev/null and b/Physics/Conveyers/sampleUI/infobutton@4x.png differ diff --git a/Physics/Conveyers/sampleUI/sampleUI.lua b/Physics/Conveyers/sampleUI/sampleUI.lua new file mode 100644 index 0000000..ff54998 --- /dev/null +++ b/Physics/Conveyers/sampleUI/sampleUI.lua @@ -0,0 +1,321 @@ + +-- Version: 1.3 +--------------------------------------------------------------------------------------- + +local widget = require( "widget" ) + +local M = {} + +local infoShowing = false + +function M:newUI( options ) + + local backGroup = display.newGroup() + local frontGroup = display.newGroup() + local textGroupContainer = display.newContainer( 288, 240 ) ; frontGroup:insert( textGroupContainer ) + local barContainer = display.newContainer( display.actualContentWidth, 30 ) + frontGroup:insert( barContainer ) + barContainer.anchorX = 0 + barContainer.anchorY = 0 + barContainer.anchorChildren = false + barContainer.x = display.screenOriginX + barContainer.y = display.screenOriginY + + local scrollBounds + local infoBoxState = "canOpen" + local transComplete + local themeName = options.theme or "darkgrey" + local sampleCodeTitle = options.title or "Sample" + local buildNum + + -- Read from the ReadMe.txt file + local readMeText = "" + local readMeFilePath = system.pathForFile( "ReadMe.txt", system.ResourceDirectory ) + if readMeFilePath then + local readMeFile = io.open( readMeFilePath ) + local rt = readMeFile:read( "*a" ) + if string.len( rt ) > 0 then readMeText = rt end + io.close( readMeFile ) ; readMeFile = nil ; rt = nil + end + + -- Create background image by theme value + local background = display.newImageRect( backGroup, "sampleUI/back-" .. themeName .. ".png", 360, 640 ) + background.x, background.y = display.contentCenterX, display.contentCenterY + + local topBarBack = display.newRect( barContainer, 0, 0, barContainer.contentWidth, barContainer.contentHeight ) + topBarBack.anchorX = 0 + topBarBack.anchorY = 0 + topBarBack:setFillColor( 0,0,0,0.2 ) + local topBarOver = display.newRect( barContainer, 0, 0, barContainer.contentWidth, barContainer.contentHeight - 2 ) + topBarOver.anchorX = 0 + topBarOver.anchorY = 0 + topBarOver:setFillColor( { type="gradient", color1={ 0.144 }, color2={ 0.158 } } ) + textGroupContainer:toBack() + + -- Check system for font selection + local useFont + if ( "android" == system.getInfo( "platform" ) or "win32" == system.getInfo( "platform" ) ) then + useFont = native.systemFont + else + useFont = "HelveticaNeue-Light" + end + self.appFont = useFont + + -- Place Solar2D title + local siteLink = display.newText( barContainer, "Solar2D", 8, topBarOver.contentHeight / 2, useFont, 14 ) + siteLink.anchorX = 0 + siteLink:setFillColor( 0.961, 0.494, 0.125 ) + if system.canOpenURL( "https://www.solar2d.com" ) then + siteLink:addEventListener( "touch", + function( event ) + if event.phase == "began" then + system.openURL( "https://www.solar2d.com" ) + end + return true + end ) + end + + -- Place sample app title + local title = display.newText( barContainer, sampleCodeTitle, barContainer.contentWidth - 28, topBarOver.contentHeight / 2, useFont, 14 ) + title.anchorX = 1 + + if options.showBuildNum == true then + buildNum = display.newText( frontGroup, "Build " .. tonumber( system.getInfo( "build" ):sub(-4) ), 0, 0, useFont, 10 ) + buildNum.anchorX = 1 + buildNum.anchorY = 1 + if ( themeName == "darkgrey" or themeName == "mediumgrey" ) then buildNum:setFillColor( 0.8 ) else buildNum:setFillColor( 0.2 ) end + end + + -- Create shade rectangle + local screenShade = display.newRect( frontGroup, 0, 0, display.actualContentWidth, display.actualContentHeight ) + screenShade:setFillColor( 0,0,0 ) ; screenShade.alpha = 0 + screenShade.x, screenShade.y = display.contentCenterX, display.contentCenterY + screenShade.isHitTestable = false ; screenShade:toBack() + + -- Create info button (initially invisible) + local infoButton = display.newImageRect( barContainer, "sampleUI/infobutton.png", 25, 25 ) + infoButton.anchorX = 1 + infoButton.x = barContainer.contentWidth - 3 + infoButton.y = topBarOver.contentHeight / 2 + infoButton.isVisible = false + infoButton.id = "infoButton" + + -- Create table for initial object positions + local objPos = { infoBoxOffY=0, infoBoxDestY=0 } + + -- Resize change handler + local function onResize( event ) + + if display.contentHeight >= display.contentWidth then + background.x, background.y, background.rotation = display.contentCenterX, display.contentCenterY, 0 + else + background.x, background.y, background.rotation = display.contentCenterX, display.contentCenterY, 90 + end + + barContainer.x = display.screenOriginX + barContainer.y = display.screenOriginY + barContainer.width = display.actualContentWidth + topBarBack.width = barContainer.width + topBarOver.width = barContainer.width + title.x = barContainer.contentWidth - 28 + infoButton.x = barContainer.contentWidth - 3 + screenShade.x = display.contentCenterX + screenShade.y = display.contentCenterY + screenShade.width = display.actualContentWidth + screenShade.height = display.actualContentHeight + textGroupContainer.x = display.contentCenterX + if buildNum then + buildNum.x = display.contentCenterX + (display.actualContentWidth / 2) - 7 + buildNum.y = display.contentCenterY + (display.actualContentHeight / 2) - 8 + end + + -- If info box is opening or already open, snap it entirely on screen + objPos["infoBoxOffY"] = display.screenOriginY - 130 + objPos["infoBoxDestY"] = (barContainer.y + barContainer.contentHeight + 130) + if ( infoBoxState == "opening" or infoBoxState == "canClose" ) then + transition.cancel( "infoBox" ) + textGroupContainer.xScale, textGroupContainer.yScale = 1,1 + textGroupContainer.y = objPos["infoBoxDestY"] + if scrollBounds then + scrollBounds.x, scrollBounds.y = display.contentCenterX, objPos["infoBoxDestY"] + end + transComplete() + -- If info box is closing or already closed, snap it entirely off screen + elseif ( infoBoxState == "closing" or infoBoxState == "canOpen" ) then + transition.cancel( "infoBox" ) + textGroupContainer.y = objPos["infoBoxOffY"] + if scrollBounds then + scrollBounds.x, scrollBounds.y = display.contentCenterX, objPos["infoBoxOffY"] + end + transComplete() + end + end + Runtime:addEventListener( "resize", onResize ) + + -- If there is ReadMe.txt content, create needed elements + if readMeText ~= "" then + + -- Create the info box scrollview + scrollBounds = widget.newScrollView + { + x = 160, + y = objPos["infoBoxDestY"], + width = 288, + height = 240, + horizontalScrollDisabled = true, + hideBackground = true, + hideScrollBar = true, + topPadding = 0, + bottomPadding = 0 + } + scrollBounds:setIsLocked( true, "vertical" ) + scrollBounds.x, scrollBounds.y = display.contentCenterX, objPos["infoBoxOffY"] + frontGroup:insert( scrollBounds ) + + local infoBoxBack = display.newRect( 0, 0, 288, 240 ) + if themeName == "whiteorange" then infoBoxBack:setFillColor( 0.88 ) + elseif themeName == "lightgrey" then infoBoxBack:setFillColor( 0.98 ) + else infoBoxBack:setFillColor( 0.78 ) end + textGroupContainer:insert( infoBoxBack ) + + -- Create the info text group + local infoTextGroup = display.newGroup() + textGroupContainer:insert( infoTextGroup ) + + -- Find and then sub out documentation links + local docLinks = {} + for linkTitle, linkURL in string.gmatch( readMeText, "%[([%w\%s\%p\%—]-)%]%(([%w\%p]-)%)" ) do + docLinks[#docLinks+1] = { linkTitle, linkURL } + end + readMeText = string.gsub( readMeText, "%[([%w\%s\%p\%—]-)%]%(([%w\%p]-)%)", "" ) + + -- Create the info text and anchoring box + local infoText = display.newText( infoTextGroup, "", 0, 0, 260, 0, useFont, 12 ) + infoText:setFillColor( 0 ) + local function trimString( s ) + return string.match( s, "^()%s*$" ) and "" or string.match( s, "^%s*(.*%S)" ) + end + readMeText = trimString( readMeText ) + infoText.text = "\n" .. readMeText + infoText.anchorX = 0 + infoText.anchorY = 0 + infoText.x = -130 + + -- Add documentation links as additional clickable text objects below main text + if #docLinks > 0 then + for i = 1,#docLinks do + local docLink = display.newText( docLinks[i][1], 0, 0, useFont, 12 ) + docLink:setFillColor( 0.9, 0.1, 0.2 ) + docLink.anchorX = 0 + docLink.anchorY = 0 + docLink.x = -130 + docLink.y = infoTextGroup.contentBounds.yMax + 5 + infoTextGroup:insert( docLink ) + if system.canOpenURL( docLinks[i][2] ) then + docLink:addEventListener( "tap", + function( event ) + system.openURL( docLinks[i][2] ) + return true + end ) + end + end + end + local spacer = display.newRect( infoTextGroup, 0, infoTextGroup.contentBounds.yMax, 10, 15 ) + spacer.anchorY = 0 ; spacer.isVisible = false + + local infoTextAnchorBox = display.newRect( infoTextGroup, 0, 0, 288, math.max( 240, infoTextGroup.height ) ) + infoTextAnchorBox.anchorY = 0 + infoTextAnchorBox.isVisible = false + + -- Set anchor point on info text group + local anc = infoTextGroup.height/120 + infoTextGroup.anchorChildren = true + infoTextGroup.anchorY = 1/anc + + -- Initially set info objects to invisible + infoTextGroup.isVisible = false + textGroupContainer.isVisible = false + + transComplete = function() + + if infoBoxState == "opening" then + scrollBounds:insert( infoTextGroup ) + infoTextGroup.x = 144 ; infoTextGroup.y = 120 + scrollBounds:setIsLocked( false, "vertical" ) + scrollBounds.x, scrollBounds.y = display.contentCenterX, objPos["infoBoxDestY"] + infoBoxState = "canClose" + infoShowing = true + if self.onInfoEvent then + self.onInfoEvent( { action="show", phase="did" } ) + end + elseif infoBoxState == "closing" then + infoTextGroup.isVisible = false + textGroupContainer.isVisible = false + scrollBounds.x, scrollBounds.y = display.contentCenterX, objPos["infoBoxOffY"] + screenShade.isHitTestable = false + infoBoxState = "canOpen" + infoShowing = false + if self.onInfoEvent then + self.onInfoEvent( { action="hide", phase="did" } ) + end + end + end + + local function controlInfoBox( event ) + if event.phase == "began" then + if infoBoxState == "canOpen" then + infoBoxState = "opening" + infoShowing = true + if self.onInfoEvent then + self.onInfoEvent( { action="show", phase="will" } ) + end + textGroupContainer.x = display.contentCenterX + textGroupContainer.y = objPos["infoBoxOffY"] + textGroupContainer:insert( infoTextGroup ) + infoTextGroup.isVisible = true + textGroupContainer.isVisible = true + textGroupContainer.xScale = 0.96 ; textGroupContainer.yScale = 0.96 + screenShade.isHitTestable = true + transition.cancel( "infoBox" ) + transition.to( screenShade, { time=400, tag="infoBox", alpha=0.75, transition=easing.outQuad } ) + transition.to( textGroupContainer, { time=900, tag="infoBox", y=objPos["infoBoxDestY"], transition=easing.outCubic } ) + transition.to( textGroupContainer, { time=400, tag="infoBox", delay=750, xScale=1, yScale=1, transition=easing.outQuad, onComplete=transComplete } ) + + elseif infoBoxState == "canClose" then + infoBoxState = "closing" + infoShowing = false + if self.onInfoEvent then + self.onInfoEvent( { action="hide", phase="will" } ) + end + textGroupContainer:insert( infoTextGroup ) + local scrollX, scrollY = scrollBounds:getContentPosition() + infoTextGroup.x = 0 ; infoTextGroup.y = scrollY + scrollBounds:setIsLocked( true, "vertical" ) + transition.cancel( "infoBox" ) + transition.to( screenShade, { time=400, tag="infoBox", alpha=0, transition=easing.outQuad } ) + transition.to( textGroupContainer, { time=400, tag="infoBox", xScale=0.96, yScale=0.96, transition=easing.outQuad } ) + transition.to( textGroupContainer, { time=700, tag="infoBox", delay=200, y=objPos["infoBoxOffY"], transition=easing.inCubic, onComplete=transComplete } ) + end + end + return true + end + + -- Set info button tap listener + infoButton.isVisible = true + infoButton:addEventListener( "touch", controlInfoBox ) + infoButton.listener = controlInfoBox + screenShade:addEventListener( "touch", controlInfoBox ) + end + + self.infoButton = infoButton + self.titleBarBottom = barContainer.y + barContainer.contentHeight - 2 + backGroup:toBack() ; self.backGroup = backGroup + frontGroup:toFront() ; self.frontGroup = frontGroup + onResize() +end + +function M:isInfoShowing() + return infoShowing +end + +return M