Exemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Texture"/> class.
 /// </summary>
 /// <param name="renderer">Renderer to use.</param>
 public Texture(Renderers.Renderer renderer)
 {
     m_Renderer = renderer;
     Width = 4;
     Height = 4;
     Failed = false;
 }
Exemplo n.º 2
0
        public Editor(Renderer renderer, string textureName)
        {
            InitializeAddins();

            MainWindow = new MainWindow();
            MainWindow.Init(renderer, textureName);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Renders the currently visible tooltip.
        /// </summary>
        /// <param name="skin"></param>
        public static void RenderToolTip(Skins.Skin skin)
        {
            if (null == g_ToolTip)
            {
                return;
            }

            Renderers.Renderer render = skin.Renderer;

            var oldRenderOffset = render.RenderOffset;
            var mousePos        = Input.InputHandler.MousePosition;
            var bounds          = g_ToolTip.ToolTip.Bounds;

            var offset = Util.FloatRect(mousePos.X - bounds.Width * 0.5f, mousePos.Y - bounds.Height - 10,
                                        bounds.Width, bounds.Height);

            offset = Util.ClampRectToRect(offset, g_ToolTip.GetCanvas().Bounds);

            //Calculate offset on screen bounds
            render.AddRenderOffset(offset);
            render.EndClip();

            skin.DrawToolTip(g_ToolTip.ToolTip);
            g_ToolTip.ToolTip.DoRender(skin);

            render.RenderOffset = oldRenderOffset;
        }
Exemplo n.º 4
0
        public void Init(Renderer renderer, string textureName)
        {
            Renderer = renderer;
            Skin = new TexturedSkin(renderer, textureName);
            Canvas = new Canvas(Skin);

            Init();
        }
Exemplo n.º 5
0
Arquivo: Font.cs Projeto: tritao/flood
 /// <summary>
 /// Initializes a new instance of the <see cref="Font"/> class.
 /// </summary>
 /// <param name="renderer">Renderer to use.</param>
 /// <param name="faceName">Face name.</param>
 /// <param name="size">Font size.</param>
 public Font(Renderers.Renderer renderer, String faceName, int size = 10)
 {
     m_Renderer = renderer;
     FaceName = faceName;
     Size = size;
     Smooth = false;
     //Bold = false;
     //DropShadow = false;
 }