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.

  1. Get Futile from Github
  2. Import the Futile.unitypackage into you Unity project, Assets->Import Package->Custom Package…
  3. Create an Empty GameObject and call it Futile Camera, GameObject->Create Empty
  4. Find the Futile script in the Project Pane and drag it to the Futile Camera object you just created.
  5. Make or find a fun and silly image, I like this one: OMG IT SPINS
  6. Now put it in you Unity project under the Asset folder and call it OMG.
  7. Click on the image and set the Texture Type to Advance and then the Non Power of 2 to None.
  8. Create a new Script file and name it FunWithFutile.cs and drag it to the Futile Camera object.
  9. 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()
        {
    
        }
    }
  10. Press play and be impressed!

Tags:

Subscribe

Subscribe to my e-mail newsletter to find out about new games and updates.

Comments are closed.