Skip to content

Instantly share code, notes, and snippets.

View jpsarda's full-sized avatar

Jean-Philippe SARDA jpsarda

View GitHub Profile
@jpsarda
jpsarda / FLabelAnimate.cs
Created October 2, 2013 15:45
A FLabel for Futile taht can be animated with GoKit
using System;
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
/*
Use :
FLabelAnimate label=new FLabelAnimate(Config.fontFile,"The quick brown fox\njumps over the lazy\ndog",Config.textParams);
TweenConfig config=new TweenConfig().intProp("endVisibleCharIdx",label.text.Length,false);
AddChild (label);
@jpsarda
jpsarda / FSpeechBubble.cs
Created September 28, 2013 23:59
FSpeechBubble for Futile. Uses latest version of GoKit (which renamed almost all classes this way : Tween > GoTween) Demo http://bonuslevel.org/experiments/futiletests/futiletests.html You need to include the following classes too : Drawing polygons https://gist.github.com/wtrebella/5444072 Drawing lines https://gist.github.com/jpsarda/4573831 D…
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System;
using System.Linq;
using System.Text;
using System.Reflection;
public class FSpeechBubble : FContainer
{
@jpsarda
jpsarda / FSplitSprite.cs
Created September 27, 2013 21:58
FSplitSprite, can be used for progress/life bars.
using UnityEngine;
using System;
/*
A sprite split in 2 parts, bottom, and top, each with its own color and alpha values.
*/
public class FSplitSprite : FSprite
{
protected Color _bottomColor=Futile.white;
@jpsarda
jpsarda / ShakeUtil.cs
Last active December 23, 2015 06:29
A shake action for Futile 2G Game engine for Unity3D.
/*
Usage :
ShakeUtil.Go(myFNode,myDurationInSeconds,myAmplitudeInPixels);
*/
public class ShakeUtil {
static Dictionary<FNode, ShakeUtil> _pendings = new Dictionary<FNode, ShakeUtil>();
public Vector2 oPosition;
@jpsarda
jpsarda / FSubSprite.cs
Last active December 21, 2015 09:59
Displays a sub area of a sprite in Futile (Unity3D) 2D game engine. Supports trimmed atlas element.
using UnityEngine;
using System;
/*
Displays a sub area of a sprite. Supports trimmed atlas elements.
Examples :
// left half
@jpsarda
jpsarda / FPseudoHtmlText.cs
Last active December 21, 2015 09:39
Renders pseudo html code with Futile (Unity2D) 2D game engine. Can render texts but also FSprites and FButtons. Example in the first comments.
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System;
using System.Linq;
using System.Text;
using System.Reflection;
@jpsarda
jpsarda / FScrollContainer.cs
Last active July 23, 2017 16:36
FScrollContainer for Unity3D Futile 2D game engine. To test it you need to change a few things in the Futile code : * _theSingleTouchable must be protected and not private * Update() must be declared virtual.
using System;
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
/*
A serie of 4 classes extending Futile classes in order to manage scrollable containers with scrollable buttons.
@jpsarda
jpsarda / FBicolorSprite.cs
Created July 30, 2013 21:05
FBicolorSprite is a FSprite class for Futile (Unity 2D engine) that manages 2 colors/alpha instead of one. Bottom color and top color.
using UnityEngine;
using System;
/*
FBicolorSprite is a FSprite with 2 colors (bottom and top).
Usage :
FBicolorSprite bicolorSprite=new FBicolorSprite("Futile_White");
@jpsarda
jpsarda / FBicolorSprite.cs
Created July 30, 2013 21:05
FBicolorSprite is a FSprite class for Futile (Unity 2D engine) that manages 2 colors/alpha instead of one. Bottom color and top color.
using UnityEngine;
using System;
/*
FBicolorSprite is a FSprite with 2 colors (bottom and top).
Usage :
FBicolorSprite bicolorSprite=new FBicolorSprite("Futile_White");
@jpsarda
jpsarda / FShadowSprite.cs
Created July 29, 2013 15:50
FShadowSprite, a class for Futile (Unity 2D engine). A FSprite showing a shadow.
using UnityEngine;
using System;
/*
FShadowSprite is a FSprite with a shadow.
TODO :
setters for _shadowOffsetX, _shadowOffsetY, _shadowColor and _shadowAlphaRatio