Skip to content

Instantly share code, notes, and snippets.

View PrimaryFeather's full-sized avatar

Daniel Sperl PrimaryFeather

View GitHub Profile
@PrimaryFeather
PrimaryFeather / Polygon.as
Last active July 31, 2017 14:53
A custom display object for Starling, rendering a regular n-sided polygon.
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;
@PrimaryFeather
PrimaryFeather / Gauge.as
Last active February 29, 2020 09:35
This Starling extension class displays a texture, trimmed to its left side, depending on a ratio. This can be used to create a progress bar or a rest-time display.
package starling.extensions
{
import starling.display.Image;
import starling.display.Sprite;
import starling.textures.Texture;
import starling.utils.MathUtil;
public class Gauge extends Sprite
{
private var _image:Image;
@PrimaryFeather
PrimaryFeather / SXGauge.h
Last active September 25, 2015 04:58
This Sparrow extension class displays a texture, trimmed to its left side, depending on a ratio. This can be used to create a progress bar or a rest-time display.
#import <Foundation/Foundation.h>
#import "Sparrow.h"
/// An SXGauge displays a texture, trimmed to its left side, depending on a ratio.
/// This can be used to display a progress bar or a time gauge.
@interface SXGauge : SPSprite
/// Indicates how much of the texture is displayed. Range: 0.0f - 1.0f
@property (nonatomic, assign) float ratio;