Skip to content

Instantly share code, notes, and snippets.

Avatar

Timothy John esidegallery

  • e side gallery
  • Swansea, UK
View GitHub Profile
@esidegallery
esidegallery / VideoTextureImageLoader.as
Last active Jun 8, 2022
Feathers (Starling) ImageLoader designed to display a video texture whose coded height is different from its display height.
View VideoTextureImageLoader.as
package feathers.controls
{
import feathers.layout.HorizontalAlign;
import feathers.layout.VerticalAlign;
import flash.display.BitmapData;
import flash.display3D.textures.VideoTexture;
import flash.geom.Point;
import flash.geom.Rectangle;
@esidegallery
esidegallery / ExtendedListItemRenderer.as
Last active Jun 26, 2017
Adds an iconProperties function to DefaultListItemRenderer, which returns an object of properties to be applied to the ImageLoader created by iconLoaderFactory. The function is expected to have the following signature: function(item:Object):Object
View ExtendedListItemRenderer.as
package feathers.controls.renderers
{
import starling.display.DisplayObject;
public class ExtendedListItemRenderer extends DefaultListItemRenderer
{
private var _iconPropertiesFunction:Function;
public function get iconPropertiesFunction():Function
{
return _iconPropertiesFunction;
@esidegallery
esidegallery / ExtendedImageLoader.as
Created Jun 26, 2017
Adds texturePreferredWidth and texturePreferredHeight properties to feathers.controls.ImageLoader so that PoT textures can work with all scaleMode and maintainAspectRatio values.
View ExtendedImageLoader.as
package feathers.controls
{
import flash.geom.Rectangle;
import feathers.layout.HorizontalAlign;
import feathers.layout.VerticalAlign;
import starling.display.Quad;
import starling.utils.RectangleUtil;
import starling.utils.ScaleMode;
View StarlingCallLater.as
package starling.extensions.starlingCallLater
{
import starling.core.Starling;
import starling.display.Stage;
import starling.events.Event;
public class StarlingCallLater
{
/**
* 2D Array of vectors containing FunctionReference instances.
@esidegallery
esidegallery / Timer.as
Last active Feb 1, 2018
Starling Timer
View Timer.as
package starling.extensions
{
import starling.animation.DelayedCall;
import starling.animation.Juggler;
import starling.core.Starling;
import starling.events.EventDispatcher;
[Event(name="timer", type="starling.events.Event")]
[Event(name="timerComplete", type="starling.events.Event")]
public class Timer extends EventDispatcher
@esidegallery
esidegallery / NativeDragSource.as
Last active Dec 6, 2021
A Feathers drag source for native drag events. The DragData object is populated with the same formats and data as the native drag's Clipboard object. The IDropTarget instances can check the format and data of dragEnter event, and if it's an accepted native format, should call DragDropManager.acceptDrag() and set NativeDragManager.dropAction.
View NativeDragSource.as
package feathers.utils
{
import feathers.dragDrop.DragData;
import feathers.dragDrop.DragDropManager;
import feathers.dragDrop.IDragSource;
import flash.desktop.Clipboard;
import flash.desktop.NativeDragActions;
import flash.desktop.NativeDragManager;
import flash.display.Sprite;