Image() public static method

public static Image ( IntPtr userTextureID, Vector2 size, Vector2 uv0, Vector2 uv1, Vector4 tintColor, Vector4 borderColor ) : void
userTextureID System.IntPtr
size Vector2
uv0 Vector2
uv1 Vector2
tintColor Vector4
borderColor Vector4
return void
Esempio n. 1
0
        public static void Image(Texture texture, Vector2f size, Color tintColor, Color borderColor)
        {
            var textureId = ConvertGlTextureHandleToImTextureId(texture.NativeHandle);

            ImGui.Image(textureId, new Vector2(size.X, size.Y), new Vector2(0, 0), new Vector2(1, 1),
                        ToImColor(tintColor).Value, ToImColor(borderColor).Value);
        }
Esempio n. 2
0
        public static void Image(Sprite sprite, Vector2f size, Color tintColor, Color borderColor)
        {
            var texture = sprite.Texture;

            // sprite without texture cannot be drawn
            if (texture is null)
            {
                return;
            }

            var textureSize = (Vector2f)texture.Size;
            var textureRect = sprite.TextureRect;

            var uv0 = new Vector2(textureRect.Left / textureSize.X, textureRect.Top / textureSize.Y);
            var uv1 = new Vector2((textureRect.Left + textureRect.Width) / textureSize.X,
                                  (textureRect.Top + textureRect.Height) / textureSize.Y);

            var textureId = ConvertGlTextureHandleToImTextureId(texture.NativeHandle);

            ImGui.Image(textureId, new Vector2(size.X, size.Y), uv0, uv1,
                        ToImColor(tintColor).Value, ToImColor(borderColor).Value);
        }
Esempio n. 3
0
        public static unsafe void Image(Sprite sprite, Vector2 size)
        {
            SpriteInfo info = GetSpriteInfo(sprite);

            ImGui.Image((IntPtr)GetTextureId(info.texture), *(NumericsV2f *)&size, info.uv0, info.uv1);
        }
Esempio n. 4
0
        public static void Image(Sprite sprite)
        {
            SpriteInfo info = GetSpriteInfo(sprite);

            ImGui.Image((IntPtr)GetTextureId(info.texture), info.size, info.uv0, info.uv1);
        }
Esempio n. 5
0
 public static unsafe void Image(Texture tex, Vector2 size)
 {
     ImGui.Image((IntPtr)GetTextureId(tex), *(NumericsV2f *)&size);
 }
Esempio n. 6
0
 public static void Image(Texture tex)
 {
     ImGui.Image((IntPtr)GetTextureId(tex), new NumericsV2f(tex.width, tex.height));
 }
 public static void Image(Texture tex, Vector2 size)
 {
     ImGui.Image((IntPtr)GetTextureId(tex), size);
 }
 public static void Image(Texture tex)
 {
     ImGui.Image((IntPtr)GetTextureId(tex), new Vector2(tex.width, tex.height));
 }