Skip to content

Instantly share code, notes, and snippets.

@ruby0x1
ruby0x1 / tilt.shift.glsl
Last active February 19, 2024 02:46
Tilt shift shader, modified from something @grapefrukt gave me
// Modified version of a tilt shift shader from Martin Jonasson (http://grapefrukt.com/)
// Read http://notes.underscorediscovery.com/ for context on shaders and this file
// License : MIT
uniform sampler2D tex0;
varying vec2 tcoord;
varying vec4 color;
/*
Take note that blurring in a single pass (the two for loops below) is more expensive than separating
@ruby0x1
ruby0x1 / haxe-unzip-example.hx
Created June 7, 2014 19:36
Unzip a file with haxe - example
public static function unzip( _path:String, _dest:String, ignoreRootFolder:String = "" ) {
var _in_file = sys.io.File.read( _path );
var _entries = haxe.zip.Reader.readZip( _in_file );
_in_file.close();
for(_entry in _entries) {
var fileName = _entry.fileName;
package enhaxe.resource.impl;
import enhaxe.math.Aabb;
import enhaxe.math.DualQuat;
import enhaxe.math.Mat44;
import enhaxe.math.Quat;
import enhaxe.math.Vec3;
import enhaxe.rendering.IGeometry;
import enhaxe.resource.Resource.IResourceData;
import enhaxe.resource.Resource.ResourceContext;
@ruby0x1
ruby0x1 / cube_test.hx
Created October 4, 2014 20:31
unofficial code from the 3D test case demo for luxeengine.com
import phoenix.Texture;
import phoenix.Batcher;
import phoenix.Camera;
import phoenix.geometry.LineGeometry;
import phoenix.geometry.QuadGeometry;
import phoenix.geometry.Geometry;
import phoenix.geometry.Vertex;
import phoenix.geometry.TextureCoord;
import phoenix.Quaternion;
@ruby0x1
ruby0x1 / CameraDrag.hx
Last active August 29, 2015 14:09
luxeengine : Simple camera drag + zoom script
import luxe.Component;
import luxe.Input.MouseButton;
import luxe.Input.MouseEvent;
import luxe.Vector;
/*
for : http://luxeengine.com
author : underscorediscovery
@ruby0x1
ruby0x1 / OrderedMap.hx
Last active April 30, 2020 22:18
A simple Haxe ordered Map implementation, MIT license
import Map;
class OrderedMapIterator<K,V> {
var map : OrderedMap<K,V>;
var index : Int = 0;
public function new(omap:OrderedMap<K,V>)
map = omap;
public function hasNext() : Bool
@ruby0x1
ruby0x1 / HoverAlpha.hx
Last active August 29, 2015 14:12
Basic hover alpha button component
import luxe.Input;
import luxe.Sprite;
import luxe.Color;
import luxe.Component;
import luxe.tween.Actuate;
class HoverAlpha extends Component {
public var amount : Float = 0.3;
@ruby0x1
ruby0x1 / alp.py
Last active August 29, 2015 14:12
modo area light to polygon
# python
import lx
import traceback
from math import atan2, sqrt, pi
# WIP, will tidy when it's done
# Modo Area light -> Polygon
# https://github.com/underscorediscovery
# To install, see the modo docs, but in short:
@ruby0x1
ruby0x1 / Test.hx
Created January 14, 2015 06:40
mint wip quick example code
//create the list view
list = new mint.List({
parent: window,
name: 'list1',
bounds: new Rect(4,28,248,400-28-4)
});
//populate it with children
import luxe.collision.ShapeDrawerLuxe;
import luxe.collision.shapes.Shape;
import luxe.collision.Collision;
import luxe.collision.CollisionData;
import luxe.Entity;
import luxe.Color;
class CollisionManager {