Skip to content

Instantly share code, notes, and snippets.

Avatar

Robert Wahler robertwahler

View GitHub Profile
View openfl
#!/bin/sh
haxelib run openfl $@
@robertwahler
robertwahler / basic_moai_helper.rb
Last active Dec 13, 2015
Thor tasks to run MOAI binaries independent of OS.
View basic_moai_helper.rb
require 'pathname'
require 'rbconfig'
require 'fileutils'
module BasicMoai
ROOT_FOLDER = File.expand_path(File.join(File.dirname(__FILE__), ".."))
SRC_FOLDER = File.join(ROOT_FOLDER, "src")
VENDOR_FOLDER = File.join(ROOT_FOLDER, "vendor")
TMP_FOLDER = File.join(ROOT_FOLDER, "tmp")
@robertwahler
robertwahler / button_sample.lua
Created Dec 28, 2012
Modified hannappe sample showing layout resize issue. Run this sample and use the mouse to change the window size. It works when making the window bigger. When you make the window smaller, the buttons don't change alignment. hanappe/projects/hanappe-samples/src/samples/gui/button_sample.lua
View button_sample.lua
module(..., package.seeall)
function onCreate(params)
view = View {
scene = scene,
layout = {
VBoxLayout {
align = {"center", "center"},
padding = {10, 10, 10, 10},
}
@robertwahler
robertwahler / WaitForExample.cs
Created Oct 20, 2015
Avoid Unity garbage collection when coroutines wait
View WaitForExample.cs
// Avoid GC when coroutines wait, instantiate outside of loop
WaitForSeconds shortWait = new WaitForSeconds(1.0f);
private IEnumerator Run() {
while (true) {
// do stuff here
yield return shortWait;
}
}
View JsonSerializer.cs
using System;
using FullSerializer;
namespace SDD.Serializers {
public static class JsonSerializer {
/// <summary>
/// Static Serializer Instance
/// </summary>