CrabUI
Loading...
Searching...
No Matches
ClickOnTransparent.cs
1using System;
2using System.Reflection;
3using System.Runtime.CompilerServices;
4using System.Collections.Generic;
5using System.Collections.Immutable;
6using System.Linq;
7using System.IO;
8
9using Barotrauma;
10using HarmonyLib;
11using Microsoft.Xna.Framework;
12using Microsoft.Xna.Framework.Graphics;
13
14using CrabUI;
15
16namespace CrabUITest
17{
18 public partial class PropTest : FillMethods
19 {
20 public static void ClickOnTransparent(CUIComponent Main)
21 {
22 CUIFrame frame = new CUIFrame()
23 {
24 Anchor = CUIAnchor.Center,
25 ResizeToSprite = true,
26 Draggable = false,
27 BackgroundSprite = new CUISprite("Dev2.png"),
28 BackgroundColor = Color.White,
29 IgnoreTransparent = true,
30 };
31
32 frame.OnMouseDown += (e) => frame.BackgroundColor = Color.Pink;
33 frame.OnMouseUp += (e) => frame.BackgroundColor = Color.White;
34
35 Main.Append(frame);
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.
Color BackgroundColor
Color of BackgroundSprite, default is black If you're using custom sprite and don't see it make sur...
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