Skip to content

Instantly share code, notes, and snippets.

View Kalinovych's full-sized avatar

Alexander Kalinovych

View GitHub Profile
Shader "Name" {
Properties {
_Name ("display name", Range (min, max)) = number
_Name ("display name", Float) = number
_Name ("display name", Int) = number
_Name ("display name", Color) = (number,number,number,number)
_Name ("display name", Vector) = (number,number,number,number)
@JohannesMP
JohannesMP / UIBlur.shader
Last active July 17, 2024 19:42
UI.Image Blur Shader with layering and masking support
Shader "Custom/UIBlur"
{
Properties
{
[Toggle(IS_BLUR_ALPHA_MASKED)] _IsAlphaMasked("Image Alpha Masks Blur", Float) = 1
[Toggle(IS_SPRITE_VISIBLE)] _IsSpriteVisible("Show Image", Float) = 1
// Internally enforced by MAX_RADIUS
_Radius("Blur Radius", Range(0, 64)) = 1
@lolzballs
lolzballs / HelloWorld.java
Created March 22, 2015 00:21
Hello World Enterprise Edition
import java.io.FileDescriptor;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
public class HelloWorld{
private static HelloWorld instance;
public static void main(String[] args){
instantiateHelloWorldMainClassAndRun();
@mountainstorm
mountainstorm / GaplessLoopedSound.as
Last active December 7, 2020 09:34
Starling2D extension to allow playing of looped mp3's without the 'click' as it loops (due to the issue with mp3 frame sizes).
/*
* Copyright (c) 2013 Mountainstorm
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
@filharvey
filharvey / DistanceFieldFont
Last active February 29, 2020 09:35
DistanceFieldFont is an extension for starling and FeathersUI to use Distance Field Fonts instead of normal Bitmap fonts. You can read more on Distance Field Fonts here: http://www.valvesoftware.com/publications/2007/SIGGRAPH2007_AlphaTestedMagnification.pdf https://code.google.com/p/libgdx/wiki/DistanceFieldFonts Currently there is no easy way …
package starling.extensions.DistanceFieldFont
{
import flash.geom.Rectangle;
import flash.utils.Dictionary;
import starling.display.Image;
import starling.text.BitmapChar;
import starling.textures.Texture;
import starling.textures.TextureSmoothing;
import starling.utils.HAlign;
@alecmce
alecmce / EnterFrameDispatcher.as
Created November 26, 2009 22:19
A strategy for creating an application 'enter-frame' signal in AS3
package
{
import org.osflash.signals.Signal;
import flash.display.MovieClip;
import flash.events.Event;
import flash.utils.getDefinitionByName;
/**
* The EnterFrameDispatcher is injected into the Main class through the [Frame] MetaData tag.
@robertpenner
robertpenner / EnterFrameDispatcher.as
Created November 26, 2009 19:49
EnterFrameDispatcher using timeline to avoid Event creation
package
{
import flash.display.MovieClip;
import org.osflash.signals.Signal;
/**
* This class needs to be associated with a movie clip symbol containing two blank frames on its timeline.
* Usage:
*
* var dispatcher:EnterFrameDispatcher = new EnterFrameDispatcher();