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.
- Get Futile from Github
- Import the Futile.unitypackage into you Unity project, Assets->Import Package->Custom Package...
- Create an Empty GameObject and call it Futile Camera, GameObject->Create Empty
- Find the Futile script in the Project Pane and drag it to the Futile Camera object you just created.
- Make or find a fun and silly image, I like this one: OMG IT SPINS
- Now put it in you Unity project under the Asset folder and call it OMG.
- Click on the image and set the Texture Type to Advance and then the Non Power of 2 to None.
- Create a new Script file and name it FunWithFutile.cs and drag it to the Futile Camera object.
- Now copy the code below into you script file.
using UnityEngine;
public class FunWithFutile : MonoBehaviour
{
// Use this for initialization
void Start()
{
FutileParams futileParams =
new FutileParams(true, true, true, true);
futileParams.AddResolutionLevel(
1024, 1, 1, "");
futileParams.origin = new Vector2(
0.5f, 0.5f);
Futile.instance.Init(futileParams);
Futile.atlasManager.LoadImage("OMG");
FSprite fSprite = new FSprite("OMG");
Futile.stage.AddChild(fSprite);
}
// Update is called once per frame
void Update()
{
}
}
- Press play and be impressed!
Guest
UserGuest
User