Example #1
0
        /// <summary>
        /// Draws a quad with a the provided texture displayed.
        /// </summary>
        /// <param name="texture">Texture to draw.</param>
        /// <param name="area">Position and size of the texture to draw. Position is relative to the canvas origin
        ///                    (top-left). If size is zero, the default texture size will be used.</param>
        /// <param name="color">Color to tint the drawn texture with.</param>
        /// <param name="scaleMode">Scale mode to use when sizing the texture. Only relevant if the provided quad size
        ///                         doesn't match the texture size.</param>
        /// <param name="depth">Depth at which to draw the element. Elements with higher depth will be drawn before others.
        ///                     Additionally elements of the same type (triangle or line) will be drawn in order they are
        ///                     submitted if they share the same depth.</param>
        public void DrawTexture(SpriteTexture texture, Rect2I area, Color color,
                                GUITextureScaleMode scaleMode = GUITextureScaleMode.StretchToFit, byte depth = 128)
        {
            IntPtr texturePtr = IntPtr.Zero;

            if (texture != null)
            {
                texturePtr = texture.GetCachedPtr();
            }

            Internal_DrawTexture(mCachedPtr, texturePtr, ref area, scaleMode, ref color, depth);
        }
Example #2
0
        /// <summary>
        /// Draws a quad with a the provided texture displayed.
        /// </summary>
        /// <param name="texture">Texture to draw.</param>
        /// <param name="area">Position and size of the texture to draw. Position is relative to the canvas origin
        ///                    (top-left). If size is zero, the default texture size will be used.</param>
        /// <param name="scaleMode">Scale mode to use when sizing the texture. Only relevant if the provided quad size
        ///                         doesn't match the texture size.</param>
        public void DrawTexture(SpriteTexture texture, Rect2I area,
                                GUITextureScaleMode scaleMode = GUITextureScaleMode.StretchToFit)
        {
            IntPtr texturePtr = IntPtr.Zero;

            if (texture != null)
            {
                texturePtr = texture.GetCachedPtr();
            }

            Color color = Color.White;

            Internal_DrawTexture(mCachedPtr, texturePtr, ref area, scaleMode, ref color);
        }