Compare commits

...

2 commits

Author SHA1 Message Date
Collin Cunningham
11b1b9c594 UIkit demo - removed testview embedding 2019-06-26 14:04:35 -04:00
Collin Cunningham
fc08c578db Simple UIKit demo
Added UILabel on center of CPX in Board Info
2019-06-26 13:54:33 -04:00
3 changed files with 28 additions and 19 deletions

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
type = "1"
version = "2.0">
</Bucket>

View file

@ -94,7 +94,8 @@ class BoardViewController: UIViewController, ARSCNViewDelegate {
var promptShown = false
//TEST
let testLabel = UILabel(frame: CGRect(x: 0, y: 0, width: 200, height: 100))
@IBOutlet weak var visualBoardEffectView: UIVisualEffectView!
var effect: UIVisualEffect!
@ -221,6 +222,16 @@ class BoardViewController: UIViewController, ARSCNViewDelegate {
let scene = SCNScene()
//TEST
testLabel.textAlignment = .center
testLabel.text = "This is a UILabel"
testLabel.backgroundColor = .blue
testLabel.textColor = .white
testLabel.cornerRadius = 10
testLabel.clipsToBounds = true
testLabel.layer.backgroundColor = UIColor.clear.cgColor
testLabel.transform = CGAffineTransform(rotationAngle: CGFloat.pi)
// Set the view's delegate
boardSceneView.delegate = self
@ -263,20 +274,6 @@ class BoardViewController: UIViewController, ARSCNViewDelegate {
animateIn()
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
@ -323,14 +320,12 @@ class BoardViewController: UIViewController, ARSCNViewDelegate {
if let imageAnchor = anchor as? ARImageAnchor {
let physicalWidth = imageAnchor.referenceImage.physicalSize.width
let physicalHeight = imageAnchor.referenceImage.physicalSize.height
// let physicalWidth = imageAnchor.referenceImage.physicalSize.width
// let physicalHeight = imageAnchor.referenceImage.physicalSize.height
switch imageAnchor.referenceImage.name {
case "cpx":
let labelScale: Float = 0.03
@ -353,6 +348,14 @@ class BoardViewController: UIViewController, ARSCNViewDelegate {
cpxStandAloneLabel.scale = SCNVector3(x: labelScale, y: labelScale, z: labelScale)
//TEST
let testPlane = SCNPlane(width: 0.1, height: 0.05)
testPlane.firstMaterial?.diffuse.contents = testLabel
testPlane.firstMaterial?.blendMode = .alpha
let testNode = SCNNode(geometry: testPlane)
planeNode.addChildNode(testNode)
//For Interactive Test
//NeoPixels
@ -362,6 +365,7 @@ class BoardViewController: UIViewController, ARSCNViewDelegate {
neoPixelInfo.isHidden = true
//ATSAMD21
ATSButton = cpxStandAloneLabel.childNode(withName: "ATSAMD21_Micro_button", recursively: true)!