CrabUI
Loading...
Searching...
No Matches
Vanilla Sprite.cs
1using System;
2using System.Reflection;
3using System.Runtime.CompilerServices;
4using System.Collections.Generic;
5using System.Collections.Immutable;
6using System.Linq;
7
8using Barotrauma;
9using HarmonyLib;
10using Microsoft.Xna.Framework;
11using Microsoft.Xna.Framework.Graphics;
12
13using CrabUI;
14
15namespace CrabUITest
16{
17 public partial class RandomTest : FillMethods
18 {
19
20 public static void VanillaSprite(CUIComponent Main)
21 {
22 CUIFrame frame = new CUIFrame(0.2f, 0.2f, 0.6f, 0.6f);
23
24 frame["img"] = new CUIComponent()
25 {
26 ResizeToSprite = true,
27 Anchor = CUIAnchor.Center,
28 BackgroundSprite = CUISprite.FromId(new Identifier("EyeButton")),
29 //BackgroundSprite = CUISprite.FromVanilla(GUIStyle.PingCircle.Value.Sprite),
30 BackgroundColor = new Color(255, 255, 255, 255),
31 };
32
33 Main.Append(frame);
34 }
35
36
37 }
38}
CUIAnchor is just a Vector2 This is a static class containing some helper methods.
Definition CUIAnchor.cs:18
Base class for all components.
virtual CUIComponent Append(CUIComponent child, string name=null, [CallerMemberName] string memberName="")
Adds children to the end of the list.
Draggable and resizable container for other components.
Definition CUIFrame.cs:16
Wrapper Containing link to texture and drawing settings, like SourceRedt, DrawMode,...
Definition CUISprite.cs:27