Ejemplo n.º 1
0
        public static IRenderContainer AddRenderObject(this IRenderContainer renderContainer, object obj)
        {
            if (obj is IInitializer initializer)
            {
                renderContainer.AddInitializer(initializer);
            }

            if (obj is IUpdatable updater)
            {
                renderContainer.AddUpdater(updater);
            }

            if (obj is IRenderable renderer)
            {
                renderContainer.AddRenderer(renderer);
            }

            return(renderContainer);
        }
Ejemplo n.º 2
0
 public ViewportRenderer(IRenderContainer container)
 {
     _container = container;
 }
Ejemplo n.º 3
0
 public static IRenderContainer AddRenderer(this IRenderContainer renderContainer, Action callback)
 {
     renderContainer.AddRenderer(new CustomRenderer(callback));
     return(renderContainer);
 }
Ejemplo n.º 4
0
 public static IRenderContainer AddRenderer(this IRenderContainer renderContainer, IRenderable renderer)
 {
     renderContainer.Renderers.Add(renderer);
     return(renderContainer);
 }
Ejemplo n.º 5
0
 public static IRenderContainer AddUpdater(this IRenderContainer renderContainer, IUpdatable updater)
 {
     renderContainer.Updaters.Add(updater);
     return(renderContainer);
 }
Ejemplo n.º 6
0
 public static IRenderContainer AddInitializer(this IRenderContainer renderContainer, IInitializer initializer)
 {
     renderContainer.Initializers.Add(initializer);
     return(renderContainer);
 }
Ejemplo n.º 7
0
 public HudRenderer(IRenderContainer container, Func <ITexture2DAtlas> fontTextureProvider, Font defaultFont)
 {
     _container           = container;
     _fontTextureProvider = fontTextureProvider;
     _defaultFont         = defaultFont;
 }