Dissapointment

I had never used the CSS style:

background-attachment: fixed;

I was ecstatic when playing around with React to implement it, but as quickly as I discovered it’s use, I learned that mobile browsers have disabled it:

 

Continue reading

Bookmark and Share

GameKit Project

Been working on a little game for iOS. It’s still missing some vital polish, but I’m very pleased with how it’s come together. Enjoy this short video I put together:

Bookmark and Share

ReactJS Does Not Play Well With WordPress HighlightJS

The nested HTML tags break HighlightJS

 


    printBodyText() {
        if (!this.props.bodyText) {
            return;
        }

        var content = [];

        if(Array.isArray(this.props.bodyText)) {
            var numParagraphs = this.props.bodyText.length;
            for (var index = 0; index < this.props.bodyText.length; ++index) {
                var paragraphString =

                content.push(

{this.props.bodyText[index]}

); } } else { content.push(

{this.props.bodyText}

); } return content }

Bookmark and Share

Monkeying Around With SpriteKit—Embedding UIViews in SKViews


import UIKit
import SpriteKit
import GameplayKit

class myFirstScene: SKScene {
    
    var vWidth:CGFloat {
        return (self.view?.frame.size.width)!
    }
    var vHeight:CGFloat {
        return (self.view?.frame.size.height)!
    }
    
    override func didMove(to skView: SKView) {
        let uiVIew: UIView = UIView(frame: CGRect(x: 0, y: vHeight * 0.25, width: (vWidth * 0.5), height: (vHeight * 0.5)))
        uiVIew.backgroundColor = UIColor.blue

        let txtView = UITextView(frame: uiVIew.bounds)
        txtView.text = "I am a UITextView \nIn a UI View\nIn a SKView \nIn an SKScene\nDrien by a UIViewController."
        txtView.textColor = UIColor.white
        txtView.textAlignment = .left
        txtView.isEditable = false
        txtView.backgroundColor = UIColor.clear
        
        uiVIew.addSubview(txtView)
        skView.addSubview(uiVIew)
    }
}

class GameViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        let skView = self.view as! SKView
        let mainViewFrame:CGRect = self.view.bounds
        let skScene = myFirstScene(size: mainViewFrame.size)
        
        skView.presentScene(skScene)
    }
}

Bookmark and Share

Swift 3.0 Card Generator: Update

Early November 2016, I pushed up a small pet project to GitHub: https://github.com/Zbeyer/CardGenerator

The application is simple: enter a few bits of information, choose a color, and set a background image and it formats a trading card. The dpi generated is not yet tweaked to work with the chosen distribution method (final TODO) but a few branches exist with slight variations on configuration.

here are some examples using background images from my static art portfolio:

Bookmark and Share

Seattle Snow

Bookmark and Share

Swift: Clock Layout Update*

While yesterday’s code solved the ‘problem’, today I took a few minutes to do some abstraction and write an alternate version that computes the positions of n points evenly spaced in a circle:


//Constant size of each node on the clock face
let kSize:CGFloat = 4

//Place a ClockFace node in the center
let clockFace:SKShapeNode = nodeGenerator(size:r, point: CGPoint( x:midPoint.x, y:midPoint.y), scene:scene)
clockFace.fillColor = SKColor.gray

//Place a normal node in the center
let centerNode:SKShapeNode = nodeGenerator(size:kSize, point: CGPoint( x:midPoint.x, y:midPoint.y), scene:scene)

//Determine radian spacing...
let nodesOnTheClock = 12
let interval:Double = 2 * M_PI / Double(nodesOnTheClock) //Radians

for index in 1...nodesOnTheClock {
    let angle:Double = M_PI_2 - Double(index) * interval
    let node:SKShapeNode = nodeGenerator(size: kSize,
                                           point: CGPoint(
                                            x:midPoint.x + r * cos(CGFloat(angle)),
                                            y:midPoint.y + r * sin(CGFloat(angle))),
                                           scene:scene)
    
}

screen-shot-2016-11-01-at-3-38-46-pm

You can grab the Gist at: https://gist.github.com/Zbeyer/038b672ba619ea93a06c1ed49608731c

The Full Code Snippet will be below the following screenshots:

Continue reading

Bookmark and Share