Exemplo n.º 1
0
 public void OnDrawGui(QGuiRenderer renderer)
 {
     if (Font != null)
     {
         renderer.DrawString(this);
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// When the scene starts it creates all the needed objects that are required by default
        /// </summary>
        internal void OnLoad()
        {
            QPrefs.Load().Wait();
            CreatorQueue   = new Queue <QEntity>();
            DestroyQueue   = new Queue <QBehavior>();
            Window         = new QWindow(Engine);
            SpriteRenderer = new QSpriteRenderer(Engine);
            GuiRenderer    = new QGuiRenderer(Engine);
            Content        = new QContentManager(Engine);
            Entities       = new QEntityManager(Engine);
            Physics        = new QPhysics();
            List <IQLoad> Loaders = new List <IQLoad>();

            //Use this method to load textures before the scene starts to compile all of them
            //so that the megatexture only has to be created once per scene so that there
            //is no delay when objects spawn, but totally optional if you have a better system
            BehaviorScriptLoader(Loaders);
            foreach (var loader in Loaders)
            {
                ((QBehavior)loader).SetName();
                ((QBehavior)loader).Parent = QEntity.GetEntity();
                loader.OnLoad(new QLoadContent(Engine, Content));
                QEntity.FreeEntity(((QBehavior)(loader)).Parent);
            }
            Accumulator         = new QAccumulator();
            Coroutine           = new QCoroutine();
            Instantiate(Console = new QConsole());
            Instantiate(Debug   = new QDebug());
            Instantiate(Camera  = new QCamera());
            CheckQueue();
            DebugView = new QDebugView(Physics.PhysicsWorld);
            DebugView.LoadContent(Engine.GraphicsDevice, Engine.Content);
            Load();
        }
Exemplo n.º 3
0
 /// <summary>
 /// Use this after OnDraw to draw things that must be on top but do not interact with the draw objects
 /// </summary>
 /// <param name="renderer"></param>
 internal void OnGui(QGuiRenderer renderer)
 {
     renderer.Begin();
     Entities.GuiObjects.For(g => g.OnDrawGui(renderer));
     renderer.End();
 }