예제 #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);
        }
예제 #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);
        }
예제 #3
0
 private static extern void Internal_DrawTexture(IntPtr nativeInstance, IntPtr texture, ref Rect2I area,
                                                 GUITextureScaleMode scaleMode, ref Color color, byte depth);
예제 #4
0
 /// <summary>
 /// Creates a new texture element.
 /// </summary>
 /// <param name="texture">Texture to display. If this is null then the texture specified by the style will
 ///                       be used.</param>
 /// <param name="scale">Scale mode to use when sizing the texture.</param>
 /// <param name="transparent">Determines should the texture be rendered with transparency active.</param>
 /// <param name="options">Options that allow you to control how is the element  positioned and sized. This will
 ///                       override any similar options set by style.</param>
 public GUITexture(SpriteTexture texture, GUITextureScaleMode scale, bool transparent, params GUIOption[] options)
 {
     Internal_CreateInstance(this, texture, scale, transparent, "", options);
 }
예제 #5
0
 private static extern void Internal_CreateInstance(GUITexture instance, SpriteTexture texture,
                                                    GUITextureScaleMode scale, bool transparent, string style, GUIOption[] options);
예제 #6
0
 /// <summary>
 /// Creates a new texture element with transparency active.
 /// </summary>
 /// <param name="texture">Texture to display. If this is null then the texture specified by the style will
 ///                       be used.</param>
 /// <param name="scale">Scale mode to use when sizing the texture.</param>
 /// <param name="style">Optional style to use for the element. Style controls the look of the element, as well as
 ///                     default layout options. Style will be retrieved from the active GUISkin. If not specified
 ///                     default element style is used.</param>
 /// <param name="options">Options that allow you to control how is the element  positioned and sized. This will
 ///                       override any similar options set by style.</param>
 public GUITexture(SpriteTexture texture, GUITextureScaleMode scale, string style, params GUIOption[] options)
 {
     Internal_CreateInstance(this, texture, scale, true, style, options);
 }
예제 #7
0
 /// <summary>
 /// Creates a new texture element.
 /// </summary>
 /// <param name="texture">Texture to display. If this is null then the texture specified by the style will 
 ///                       be used.</param>
 /// <param name="scale">Scale mode to use when sizing the texture.</param>
 /// <param name="transparent">Determines should the texture be rendered with transparency active.</param>
 /// <param name="options">Options that allow you to control how is the element  positioned and sized. This will 
 ///                       override any similar options set by style.</param>
 public GUITexture(SpriteTexture texture, GUITextureScaleMode scale, bool transparent, params GUIOption[] options)
 {
     Internal_CreateInstance(this, texture, scale, transparent, "", options);
 }
예제 #8
0
 private static extern void Internal_CreateInstance(GUITexture instance, SpriteTexture texture,
     GUITextureScaleMode scale, bool transparent, string style, GUIOption[] options);
예제 #9
0
 /// <summary>
 /// Creates a new texture element with transparency active.
 /// </summary>
 /// <param name="texture">Texture to display. If this is null then the texture specified by the style will 
 ///                       be used.</param>
 /// <param name="scale">Scale mode to use when sizing the texture.</param>
 /// <param name="style">Optional style to use for the element. Style controls the look of the element, as well as 
 ///                     default layout options. Style will be retrieved from the active GUISkin. If not specified 
 ///                     default element style is used.</param>
 /// <param name="options">Options that allow you to control how is the element  positioned and sized. This will 
 ///                       override any similar options set by style.</param>
 public GUITexture(SpriteTexture texture, GUITextureScaleMode scale, string style, params GUIOption[] options)
 {
     Internal_CreateInstance(this, texture, scale, true, style, options);
 }