Skip to content

Instantly share code, notes, and snippets.

View rayyee's full-sized avatar
🌴
On vacation

Ray Yee rayyee

🌴
On vacation
View GitHub Profile
package utils
{
import com.adobe.utils.AGALMiniAssembler;
import flash.display3D.*;
import flash.geom.*;
import starling.core.RenderSupport;
import starling.core.Starling;
import starling.display.DisplayObject;
{
"selector": "source.jsfl",
"cmd": ["Flash" ,"$file"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)"
}
/**
* Copyright (c) 2013 Amos Laber
*
* 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:
*
// =================================================================================================
//
// based on starling.text.TextField
// modified to use text layout framework engine for rendering text
//
// =================================================================================================
package starling.extensions
{
import flash.display.BitmapData;
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;
attribute vec4 a_position;
attribute vec3 a_normal;
attribute vec2 a_texCoord;
attribute vec2 a_texCoord1;
varying vec2 v_texture_coord;
varying vec2 v_texture_coord1;
// height of the wave in world units.
uniform float u_amplitude;
attribute vec4 a_position;
attribute vec2 a_texCoord;
attribute vec2 a_texCoord1;
attribute vec2 a_texCoord2;
attribute vec4 a_color;
varying vec4 v_color;
varying vec2 v_texture_coord;
varying vec2 v_texture_coord1;
varying vec2 v_texture_coord2;
#ifdef GL_ES
varying mediump vec2 v_texture_coord;
varying mediump vec2 v_texture_coord1;
#else
varying vec2 v_texture_coord;
varying vec2 v_texture_coord1;
#endif
uniform sampler2D lightmap;
void main(void)
attribute vec4 a_position;
attribute vec2 a_texCoord;
attribute vec2 a_texCoord1;
varying vec2 v_texture_coord;
varying vec2 v_texture_coord1;
void main(void)
{
gl_Position = CC_MVPMatrix * a_position;
v_texture_coord.x = a_texCoord.x;
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit