Futile Quick Start
Futile is a framework that allows you to control rendering within Unity programmatically. This is a boon to anyone interested in 2D games and finds, like myself, that Unity impedes 2D game development.
Steps:
- Get Futile from Github
- Import the Futile.unitypackage into Unity project
- Create an Empty GameObject called “Futile Camera”
- Drag Futile script to the “Futile Camera” object
- Add an image (example below)
- Configure image texture settings
- Create a new script “FunWithFutile.cs”
- Add the code below to the script
- Press play
using UnityEngine;
using System.Collections;
public class FunWithFutile : MonoBehaviour, FutileUpdateDelegate
{
void Start()
{
FutileParams fparams = new FutileParams(true, true, true, true);
fparams.AddResolutionLevel(480.0f, 1.0f, 1.0f, "");
fparams.origin = new Vector2(0.5f, 0.5f);
Futile.instance.Init(fparams);
Futile.atlasManager.LoadAtlas("Atlases/MyAtlas");
Futile.instance.UpdateDelegate = this;
Go.to(this, 1.0f, new TweenConfig().floatProp("rotation", 360.0f).setIterations(-1));
}
public void HandleFutileUpdate()
{
// Update logic here
}
}
Note: This post was imported from mrphilgames.com
Categories: news, unity, development