NYC Programmer Mario Gonzalez's blog


This author hasn't added his/her bio.

NPM install from branch on private repo

Something you need a specific branch of a repository that has not been published yet. git+http://git@SUBDOMAIN.DOMAIN.COM/USER/REPO-URL.git#4d331600 For example: // this URL   // becomes in your package.json git+ Swap HTTP for HTTPS, depending on your repo location

Running a python/shell script from the UnityEditor

While working on your game, sometimes you develop little python or shell scripts that help along the process, and it’d be nice to run them from the editor. Or better yet, during your automated build process, have it call out to this from within Unity. It’s actually quite simple, and you can even capture the output into the editor. [MenuItem("MyGame/Downscale Reference Textures")] public static void DownscaleRefTextures() { // using System.Diagnostics; Process p =.. Read More

ios-creating-reusable-uiviews-with-storyboard – Part 2

This has is an updated version of ios-creating-reusable-uiviews-with-storyboard for Xcode 6. TL:DR version: Create a new UIView subclass name it MyView.h/MyView.h Create a new XIB name it MyView.xib In MyView.xib select the File’s Owner and set the class (using the right pane, third tab) to MyView Create an IBOutlet in MyView.h is of the type UIView*, call it contentView In InterfaceBuilder (with MyView.xib open) right-click drag the File’s Owner the root view, and.. Read More

Open two instances of Unity at once

Sometimes you have a project that you’re using as reference, maybe you added some functionality in a previous project or you downloaded a sample project and you are trying to recreate that thing in your new project. It would be great if you could have them both open side by side so you can compare them right? Unfortunately if you try to open Unity by clicking the icon, it will just bring your.. Read More

Create iOS / Android icons from master icon

This is just a simple script that will create your iOS icons from a masterfile. I’m using it on a Unity project (Even though Unity will make the icons for you, the way it resizes the images leaves them appearing jaggy). It works best with a 1024×768 icon as the source #!/bin/bash # Author: Mario Gonzalez # Modified for iOS7 from: f=$(pwd)   # App Icon – iPhone iOS7+ sips –resampleWidth 60.. Read More

Using Greensock JS / TweenMax in a Dart application

Once you use Greensock / TweenMax / TweenLite, you don’t really want to use anything else. It’s fast, it’s feature rich, and it works on more browsers than dart itself. This is a quick post on how to use the animation library, it’s surprisingly easy. First import the dart:js library import ‘dart:js’; Next, add dart.interop.js to your HTML after your own apps script tags. Mine looks like this: <script type="application/dart" src="dart/mandala.dart"></script> <script src="packages/browser/dart.js"></script>.. Read More

Placing an AppKit controls over a NSOpenGLView / CinderView

Currently working on an OSX application that requires UI controls to live above a CinderView (Which is a type of NSOpenGLView). Obviously first I tried to simply place the objects above one another in InterfaceBuilder, but that had no effect. The NSOpenGLView always draws above all other content. Next I tried some information someone suggested, with switching to layer-backed views. That crashed my application on startup. Instead what I found that worked, was.. Read More

[iOS] Creating reusable UIViews with Storyboard

I’m a big fan of using Storyboards to act as the glue for your application. It just makes everything much easier, and makes your program feel like a cohesive application instead of a random assortment of UIViewControllers However one problem is that, Storyboards don’t lend themselves to having reusable views. Which I find kind of odd, because it seems common that you would have a view that needs to exist in multiple screens.. Read More

Compiling LESS from a node.js script

LESS is a tool that allows you to write CSS in a programmer friendly way (with variables, and some simple functions), it then converts it to regular CSS for browser friendly consumption. It’s amazingly easy to use, during development you don’t have to change a thing. You simply import your .less file, then under you import ‘less.js’ and it does it’s magic. Eventually you need to preprocess it as part of your build.. Read More

A Little About Digital Audio and Linear PCM

This is from Apple’s documentation on CoreAudio. Since I find wikipedia to be only marginally helpful these days (it actually suffers from TOO much information) I found it explained these concepts so well, I had to quote it for future reference. A Little About Digital Audio and Linear PCM Most Core Audio services use and manipulate audio in linear pulse-code-modulated (linear PCM) format, the most common uncompressed digital audio data format. Digital audio.. Read More