public ScrollableContainer(string uniqueName, Vector2i size, IResourceManager resourceManager)
        {
            _resourceManager = resourceManager;

            Size = size;

            //if (RenderTargetCache.Targets.Contains(uniqueName))
            //    //Now this is an ugly hack to work around duplicate RenderImages. Have to fix this later.
            //    uniqueName = uniqueName + Guid.NewGuid();

            clippingRI = new RenderImage(uniqueName,(uint)Size.X,(uint) Size.Y);

            //clippingRI.SourceBlend = AlphaBlendOperation.SourceAlpha;
            //clippingRI.DestinationBlend = AlphaBlendOperation.InverseSourceAlpha;
            //clippingRI.SourceBlendAlpha = AlphaBlendOperation.SourceAlpha;
            //clippingRI.DestinationBlendAlpha = AlphaBlendOperation.InverseSourceAlpha;
            clippingRI.BlendSettings.ColorSrcFactor = BlendMode.Factor.SrcAlpha;
            clippingRI.BlendSettings.ColorDstFactor = BlendMode.Factor.OneMinusSrcAlpha;
            clippingRI.BlendSettings.AlphaSrcFactor = BlendMode.Factor.SrcAlpha;
            clippingRI.BlendSettings.AlphaDstFactor = BlendMode.Factor.OneMinusSrcAlpha;

            scrollbarH = new Scrollbar(true, _resourceManager);
            scrollbarV = new Scrollbar(false, _resourceManager);
            scrollbarV.size = Size.Y;

            scrollbarH.Update(0);
            scrollbarV.Update(0);

            Update(0);
        }
        public ScrollableContainer(string uniqueName, Size size, IResourceManager resourceManager)
        {
            _resourceManager = resourceManager;

            Size = size;

            //if (RenderTargetCache.Targets.Contains(uniqueName))
            //    //Now this is an ugly hack to work around duplicate RenderImages. Have to fix this later.
            //    uniqueName = uniqueName + Guid.NewGuid();

            clippingRI = new RenderImage((uint)Size.Width,(uint) Size.Height);
                clippingRI.setName = uniqueName;
                clippingRI.setImageBuffer = ImageBufferFormats.BufferRGB888A8;
            scrollbarH = new Scrollbar(true, _resourceManager);
            scrollbarV = new Scrollbar(false, _resourceManager);
            scrollbarV.size = Size.Height;

            scrollbarH.Update(0);
            scrollbarV.Update(0);

            //clippingRI.SourceBlend = AlphaBlendOperation.SourceAlpha;
            //clippingRI.DestinationBlend = AlphaBlendOperation.InverseSourceAlpha;

            //clippingRI.SourceBlendAlpha = AlphaBlendOperation.SourceAlpha;
            //clippingRI.DestinationBlendAlpha = AlphaBlendOperation.InverseSourceAlpha;

            Update(0);
        }