Пример #1
0
 public GUIContentImages(SpriteTexture image)
 {
     this.normal    = image;
     this.hover     = image;
     this.active    = image;
     this.focused   = image;
     this.normalOn  = image;
     this.hoverOn   = image;
     this.activeOn  = image;
     this.focusedOn = image;
 }
Пример #2
0
 /// <summary>
 /// Creates a new object where content images for on and off states are different.
 /// </summary>
 /// <param name="imageOff">Image to assign to all off states.</param>
 /// <param name="imageOn">Image to assign to all on states.</param>
 public GUIContentImages(SpriteTexture imageOff, SpriteTexture imageOn)
 {
     normal    = imageOff;
     hover     = imageOff;
     active    = imageOff;
     focused   = imageOff;
     normalOn  = imageOn;
     hoverOn   = imageOn;
     activeOn  = imageOn;
     focusedOn = imageOn;
 }
Пример #3
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);
        }
Пример #4
0
 private static extern void Internal_create0(SpriteTexture managedInstance, ref Vector2 uvOffset, ref Vector2 uvScale, RRef <Texture> texture);
Пример #5
0
 private static extern void Internal_create(SpriteTexture managedInstance, RRef <Texture> texture);
Пример #6
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="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, bool transparent, string style, params GUIOption[] options)
 {
     Internal_CreateInstance(this, texture, scale, transparent, style, options);
 }
Пример #7
0
 /// <summary>
 /// Creates a new texture element. Texture will use the default StretchToFit scaling.
 /// </summary>
 /// <param name="texture">Texture to display. If this is null then the texture specified by the style will
 ///                       be used.</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, bool transparent, params GUIOption[] options)
 {
     Internal_CreateInstance(this, texture, GUITextureScaleMode.StretchToFit, transparent, "", options);
 }
Пример #8
0
 private static extern void Internal_SetTexture(IntPtr nativeInstance, SpriteTexture texture);
Пример #9
0
 private static extern void Internal_CreateInstance(GUITexture instance, SpriteTexture texture,
                                                    GUITextureScaleMode scale, bool transparent, string style, GUIOption[] options);
Пример #10
0
 /// <summary>
 /// Sets the texture to display.
 /// </summary>
 /// <param name="texture">Texture to display. If this is null then the texture specified by the style will
 ///                       be used.</param>
 public void SetTexture(SpriteTexture texture)
 {
     Internal_SetTexture(mCachedPtr, texture);
 }
Пример #11
0
 /// <summary>
 /// Creates a new texture element with transparency active. Texture will use the default StretchToFit scaling.
 /// </summary>
 /// <param name="texture">Texture to display. If this is null then the texture specified by the style will
 ///                       be used.</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, string style, params GUIOption[] options)
 {
     Internal_CreateInstance(this, texture, GUITextureScaleMode.StretchToFit, true, style, options);
 }
Пример #12
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="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, params GUIOption[] options)
 {
     Internal_CreateInstance(this, texture, scale, true, "", options);
 }