Skip to content

Instantly share code, notes, and snippets.

View tony56a's full-sized avatar

Tony Du tony56a

  • Waterloo
View GitHub Profile
@tony56a
tony56a / gist:6940800671df97aa524bcef5e3f3cf14
Created January 21, 2017 05:03
Description of all current Mark-a-Route signs
{ "hwysign",
new TextureSignPropInfo(1,
new List<float> { 0f },
new List<Rect> {new Rect(133,15,780,348) },
new List<string> { "Main Sign" } )
},
{ "double gantry sign",
new TextureSignPropInfo(3,
new List<float> { 0f,0f,0f },
new List<Rect> { new Rect(220,5,581,364),
Material material = m_signPropDict[signPropType].m_material;
if ( signPropType == "double gantry sign")
{
Texture2D texture = material.mainTexture as Texture2D;
material = Instantiate(m_signPropDict[signPropType].m_material) as Material;
Texture2D texCopy = new Texture2D(texture.width, texture.height, TextureFormat.RGBA32, false);
texCopy.SetPixels(texture.GetPixels());
Texture2D otherTexture = SpriteUtils.mTextureStore["bipintemplate1"];
Texture2D otherTexture2 = SpriteUtils.mTextureStore["bipintemplate2"];
@tony56a
tony56a / NotifyrUI.py
Last active August 29, 2015 14:08
Some kind of screen simulator for Notifyr, so we can do UI design without the actual hardware(needs pygame to work). Doesn't really match any of Notifyr APIs tho
#! /usr/bin/env python
import sys
import pygame
import csv
import re
import signal
sys.path.insert(0,"../..")
@tony56a
tony56a / script.py
Created February 3, 2013 07:03
Quick and Dirty Testing thingy for a custom USB Display thing using PyUSB Display accepts a full display of 320*240*2 bytes in a 16 bit RGB format sequence. Test script pulls an image from lorempixel.com and sends it to the screen. Uses bitmap bit conversion functions from Logitech-G19-Linux-Daemon by MultiCoreNop
from PIL import Image
import urllib
import usb.core, usb.util
dev = usb.core.find(idVendor = 0x1cbe, idProduct=0x0003)
def download_image():
urllib.urlretrieve ("http://lorempixel.com/640/480/", "image.jpg")
def rgb_to_uint16(r,g,b):